From 138e078984da01f204e97a44f9a20f0a8fa5326a Mon Sep 17 00:00:00 2001 From: mrkusypl Date: Fri, 20 Mar 2026 10:47:50 +0100 Subject: [PATCH] Fix for S-meter calculation, AirCopy - removed redundant code --- App/app/aircopy.c | 16 ---------------- App/ui/main.c | 8 ++++---- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/App/app/aircopy.c b/App/app/aircopy.c index 60991e5c..62d63e19 100644 --- a/App/app/aircopy.c +++ b/App/app/aircopy.c @@ -276,22 +276,6 @@ void AIRCOPY_StorePacket(void) } uint16_t Offset = g_FSK_Buffer[1]; - const AIRCOPY_TransferMap_t *map = AIRCOPY_GetCurrentMap(); - - // Validate offset is in the map - bool validOffset = false; - for (uint16_t i = 0; i < map->num_segments; i++) { - if (Offset >= map->segments[i].start_offset && Offset < map->segments[i].end_offset) { - validOffset = true; - break; - } - } - - if (!validOffset) { - gErrorsDuringAirCopy++; - AIRCOPY_CheckComplete(); - return; - } const AIRCOPY_Segment_t *seg = AIRCOPY_FindSegmentForOffset(Offset); diff --git a/App/ui/main.c b/App/ui/main.c index 86d2a2c4..58e43330 100644 --- a/App/ui/main.c +++ b/App/ui/main.c @@ -345,12 +345,12 @@ void DisplayRSSIBar(const bool now) // else if (rssi_dBm >= -141) s_level = 1; // S1 = -141 dBm // else s_level = 0; // S0 (below -141 dBm) - s_level = (rssi_dBm + 147) / 6; - - if (s_level > 9) + if (rssi_dBm >= -93) s_level = 9; - else if (s_level < 0) + else if (rssi_dBm < -141) s_level = 0; + else + s_level = (rssi_dBm + 147) / 6; if (s_level == 9) { // Compute over-S9 dB directly