From e0f653b955a29ea175290e6f3edc9d5a9e36724d Mon Sep 17 00:00:00 2001 From: faulty Date: Tue, 22 Aug 2023 11:39:08 -0500 Subject: [PATCH 1/2] Fixed incorrect channel spacing sanity check --- src/lookups/IdenTableLookup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lookups/IdenTableLookup.cpp b/src/lookups/IdenTableLookup.cpp index 9f234173..103560f3 100644 --- a/src/lookups/IdenTableLookup.cpp +++ b/src/lookups/IdenTableLookup.cpp @@ -82,10 +82,10 @@ IdenTable IdenTableLookup::find(uint32_t id) if (chBandwidthKhz == 0.0F) chBandwidthKhz = 12.5F; float chSpaceKhz = entry.chSpaceKhz(); - if (chSpaceKhz < 2.5F) // clamp to 2.5 - chSpaceKhz = 2.5F; - if (chSpaceKhz > 6.25F) // clamp to 6.25 - chSpaceKhz = 6.25F; + if (chSpaceKhz < 0.125F) // clamp to 2.5 + chSpaceKhz = 0.125F; + if (chSpaceKhz > 125000.0F) // clamp to 6.25 + chSpaceKhz = 125000.0F; return IdenTable(entry.channelId(), entry.baseFrequency(), chSpaceKhz, entry.txOffsetMhz(), chBandwidthKhz); } From cb7d8ce9a6ea17cc264b9a4f3c0281a921b799c1 Mon Sep 17 00:00:00 2001 From: faulty Date: Tue, 22 Aug 2023 11:51:21 -0500 Subject: [PATCH 2/2] Updated comments --- src/lookups/IdenTableLookup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lookups/IdenTableLookup.cpp b/src/lookups/IdenTableLookup.cpp index 103560f3..c9377425 100644 --- a/src/lookups/IdenTableLookup.cpp +++ b/src/lookups/IdenTableLookup.cpp @@ -82,9 +82,9 @@ IdenTable IdenTableLookup::find(uint32_t id) if (chBandwidthKhz == 0.0F) chBandwidthKhz = 12.5F; float chSpaceKhz = entry.chSpaceKhz(); - if (chSpaceKhz < 0.125F) // clamp to 2.5 + if (chSpaceKhz < 0.125F) // clamp to 125Hz chSpaceKhz = 0.125F; - if (chSpaceKhz > 125000.0F) // clamp to 6.25 + if (chSpaceKhz > 125000.0F) // clamp to 125KHz chSpaceKhz = 125000.0F; return IdenTable(entry.channelId(), entry.baseFrequency(), chSpaceKhz, entry.txOffsetMhz(), chBandwidthKhz);