S0 and S9 value settings #174

This commit is contained in:
Krzysiek Egzmont
2023-12-09 15:40:38 +01:00
parent 0c2fc6184c
commit 268c4dece3
3 changed files with 22 additions and 9 deletions

View File

@@ -132,9 +132,13 @@ void SETTINGS_InitEEPROM(void)
memmove(&gEeprom.POWER_ON_PASSWORD, Data, 4);
// 0EA0..0EA7
#ifdef ENABLE_VOICE
EEPROM_ReadBuffer(0x0EA0, Data, 8);
gEeprom.VOICE_PROMPT = (Data[0] < 3) ? Data[0] : VOICE_PROMPT_ENGLISH;
EEPROM_ReadBuffer(0x0EA0, Data, 8);
#ifdef ENABLE_VOICE
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;
#endif
// 0EA8..0EAF
@@ -524,8 +528,13 @@ void SETTINGS_SaveSettings(void)
memset(State, 0xFF, sizeof(State));
#ifdef ENABLE_VOICE
State[0] = gEeprom.VOICE_PROMPT;
EEPROM_WriteBuffer(0x0EA0, State);
#endif
#ifdef ENABLE_RSSI_BAR
State[1] = gEeprom.S0_LEVEL;
State[2] = gEeprom.S9_LEVEL;
#endif
EEPROM_WriteBuffer(0x0EA0, State);
#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750)
State[0] = gEeprom.ALARM_MODE;