Skip to content

Commit

Permalink
FIX #92: Adjust s-meter values
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Nov 22, 2023
1 parent fdd7fc0 commit 6730746
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,19 @@ static void DisplayRSSIBar(const int16_t rssi, const bool now)

if (now)
memset(p_line, 0, LCD_WIDTH);


const int8_t dBmCorrTable[7] = {
-15, // band 1
-15, // band 2
-25, // band 3
-20, // band 4
-20, // band 5
-20, // band 6
-7 // band 7
};

const int16_t s0_dBm = -147; // S0 .. base level
const int16_t rssi_dBm = (rssi / 2) - 160;
const int16_t rssi_dBm = (rssi / 2) - 160 + dBmCorrTable[gRxVfo->Band];

const uint8_t s_level = MIN(MAX((rssi_dBm - s0_dBm) / 6, 0), 9); // S0 - S9
uint8_t overS9dBm = MIN(MAX(rssi_dBm - (s0_dBm + 9*6), 0), 99);
Expand Down

0 comments on commit 6730746

Please sign in to comment.