From 00a2bc75b88c978db6e55529202ad4d5c75b7c2c Mon Sep 17 00:00:00 2001 From: Krzysiek Egzmont Date: Wed, 13 Dec 2023 13:48:18 +0100 Subject: [PATCH] Tighter constraints for S0, S9 s-meter EEPROM settings #252 --- settings.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/settings.c b/settings.c index b75d045..d42bc40 100644 --- a/settings.c +++ b/settings.c @@ -137,8 +137,14 @@ void SETTINGS_InitEEPROM(void) gEeprom.VOICE_PROMPT = (Data[0] < 3) ? Data[0] : VOICE_PROMPT_ENGLISH; #endif #ifdef ENABLE_RSSI_BAR - gEeprom.S0_LEVEL = (Data[1] < 0xFF) ? Data[1] : 130; - gEeprom.S9_LEVEL = (Data[2] < gEeprom.S0_LEVEL-9) ? Data[2] : 76; + if((Data[1] < 200 && Data[1] > 90) && (Data[2] < Data[1]-9 && Data[2] > 50)) { + gEeprom.S0_LEVEL = Data[1]; + gEeprom.S9_LEVEL = Data[2]; + } + else { + gEeprom.S0_LEVEL = 130; + gEeprom.S9_LEVEL = 76; + } #endif // 0EA8..0EAF