Skip to content

Commit 00a2bc7

Browse files
committed
Tighter constraints for S0, S9 s-meter EEPROM settings #252
1 parent 268c4de commit 00a2bc7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

settings.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,14 @@ void SETTINGS_InitEEPROM(void)
137137
gEeprom.VOICE_PROMPT = (Data[0] < 3) ? Data[0] : VOICE_PROMPT_ENGLISH;
138138
#endif
139139
#ifdef ENABLE_RSSI_BAR
140-
gEeprom.S0_LEVEL = (Data[1] < 0xFF) ? Data[1] : 130;
141-
gEeprom.S9_LEVEL = (Data[2] < gEeprom.S0_LEVEL-9) ? Data[2] : 76;
140+
if((Data[1] < 200 && Data[1] > 90) && (Data[2] < Data[1]-9 && Data[2] > 50)) {
141+
gEeprom.S0_LEVEL = Data[1];
142+
gEeprom.S9_LEVEL = Data[2];
143+
}
144+
else {
145+
gEeprom.S0_LEVEL = 130;
146+
gEeprom.S9_LEVEL = 76;
147+
}
142148
#endif
143149

144150
// 0EA8..0EAF

0 commit comments

Comments
 (0)