RssiPowerOff alarm enabled by default (#5129)

* RssiPowerOff alarm enabled by default
+ Companion support

* Fix continuously toggling RSSI on shutdown setting on X9
This commit is contained in:
Bertrand Songis
2017-08-04 11:01:52 +02:00
committed by Andre Bernet
parent 6304f0daf6
commit 76e72c8a86
12 changed files with 147 additions and 88 deletions
+1 -1
View File
@@ -894,7 +894,7 @@ PACK(struct TrainerData {
NOBACKUP(uint8_t countryCode); \
NOBACKUP(uint8_t imperial:1); \
NOBACKUP(uint8_t jitterFilter:1); /* 0 - active */\
NOBACKUP(uint8_t rssiPoweroffAlarm:1); \
NOBACKUP(uint8_t disableRssiPoweroffAlarm:1); \
NOBACKUP(uint8_t spareExtraArm:5); \
NOBACKUP(char ttsLanguage[2]); \
NOBACKUP(int8_t beepVolume:4); \
+3 -2
View File
@@ -383,7 +383,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_ALARM_WARNING:
{
uint8_t b = 1-g_eeGeneral.disableAlarmWarning;
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
break;
}
@@ -391,7 +391,8 @@ void menuRadioSetup(event_t event)
#if defined(CPUARM)
case ITEM_SETUP_RSSI_POWEROFF_ALARM:
{
g_eeGeneral.rssiPoweroffAlarm = editCheckBox(g_eeGeneral.rssiPoweroffAlarm, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
break;
}
#endif
+4 -3
View File
@@ -332,21 +332,22 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_MEMORY_WARNING:
{
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
uint8_t b = 1 - g_eeGeneral.disableMemoryWarning;
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event);
break;
}
case ITEM_SETUP_ALARM_WARNING:
{
uint8_t b = 1-g_eeGeneral.disableAlarmWarning;
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
break;
}
case ITEM_SETUP_RSSI_POWEROFF_ALARM:
{
g_eeGeneral.rssiPoweroffAlarm = editCheckBox(g_eeGeneral.rssiPoweroffAlarm, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
break;
}
+3 -12
View File
@@ -331,20 +331,10 @@ bool menuRadioSetup(event_t event)
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
break;
#if 0
case ITEM_SETUP_MEMORY_WARNING:
{
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_MEMORYWARNING);
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, attr, event);
break;
}
#endif
case ITEM_SETUP_ALARM_WARNING:
{
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_ALARMWARNING);
uint8_t b = 1-g_eeGeneral.disableAlarmWarning;
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, attr, event);
break;
}
@@ -352,7 +342,8 @@ bool menuRadioSetup(event_t event)
case ITEM_SETUP_RSSI_POWEROFF_ALARM:
{
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_RSSISHUTDOWNALARM);
g_eeGeneral.rssiPoweroffAlarm = editCheckBox(g_eeGeneral.rssiPoweroffAlarm, RADIO_SETUP_2ND_COLUMN, y, attr, event);
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, attr, event);
break;
}
+3 -3
View File
@@ -2763,7 +2763,7 @@ uint32_t pwrCheck()
}
else if (pwr_press_time == 0) {
pwr_press_time = get_tmr10ms();
if (message && g_eeGeneral.rssiPoweroffAlarm) {
if (message && !g_eeGeneral.disableRssiPoweroffAlarm) {
audioEvent(AU_MODEL_STILL_POWERED);
}
}
@@ -2792,7 +2792,7 @@ uint32_t pwrCheck()
}
}
#else
while ((TELEMETRY_STREAMING() && g_eeGeneral.rssiPoweroffAlarm)) {
while ((TELEMETRY_STREAMING() && !g_eeGeneral.disableRssiPoweroffAlarm)) {
lcdRefreshWait();
lcdClear();
POPUP_CONFIRMATION("Confirm Shutdown");
@@ -2846,7 +2846,7 @@ uint32_t pwrCheck()
}
#endif
if (g_eeGeneral.rssiPoweroffAlarm) {
if (!g_eeGeneral.disableRssiPoweroffAlarm) {
if (TELEMETRY_STREAMING()) {
RAISE_ALERT(STR_MODEL, STR_MODEL_STILL_POWERED, STR_PRESS_ENTER_TO_CONFIRM, AU_MODEL_STILL_POWERED);
while (TELEMETRY_STREAMING()) {