Allow to disable telemetry alarams (#4981)
* Allow to disable telemetry alarams This mainly useful for cheap transceivers that have telemetry but no power amplifier and very limited range of often 10-20 meters. This includes fishpepper's tinyFISH FC (and its legal/illegal clones) and also Spektrum BNF models. * Always disable a warning when RSSI Warnings are disabled * Compile fix * Fix typos, also mute sensor lost Refactor the FrskyRSSIAlarm[2] into a EEPROM compatible RssiAlarm struct * Compile fixes * Also refactor Companion * Cleanup unused datastruct on ARM * Compile fix for AVR * Change int to uin8_t for avr * Fix strings
This commit is contained in:
committed by
Bertrand Songis
parent
656daa75fa
commit
8e07f9b0f4
@@ -41,6 +41,7 @@ enum MenuModelTelemetryFrskyItems {
|
||||
ITEM_TELEMETRY_RSSI_ALARM1,
|
||||
ITEM_TELEMETRY_RSSI_ALARM2,
|
||||
#if defined(CPUARM)
|
||||
ITEM_TELEMETRY_DISABLE_ALARMS,
|
||||
ITEM_TELEMETRY_SENSORS_LABEL,
|
||||
ITEM_TELEMETRY_SENSOR1,
|
||||
ITEM_TELEMETRY_SENSOR2,
|
||||
@@ -151,7 +152,7 @@ enum MenuModelTelemetryFrskyItems {
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define RSSI_ROWS LABEL(RSSI), 0, 0,
|
||||
#define RSSI_ROWS LABEL(RSSI), 0, 0, 1,
|
||||
#else
|
||||
#define RSSI_ROWS LABEL(RSSI), 1, 1,
|
||||
#endif
|
||||
@@ -704,14 +705,18 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
|
||||
case ITEM_TELEMETRY_RSSI_ALARM1:
|
||||
case ITEM_TELEMETRY_RSSI_ALARM2: {
|
||||
uint8_t alarm = k-ITEM_TELEMETRY_RSSI_ALARM1;
|
||||
#if defined(CPUARM)
|
||||
lcdDrawTextAlignedLeft(y, (alarm==0 ? STR_LOWALARM : STR_CRITICALALARM));
|
||||
lcdDrawNumber(LCD_W, y, getRssiAlarmValue(alarm), RIGHT | attr, 3);
|
||||
bool warning = (k==ITEM_TELEMETRY_RSSI_ALARM1);
|
||||
lcdDrawTextAlignedLeft(y, (warning ? STR_LOWALARM : STR_CRITICALALARM));
|
||||
lcdDrawNumber(LCD_W, y, warning? g_model.rssiAlarms.getWarningRssi() : g_model.rssiAlarms.getCriticalRssi(), RIGHT | attr, 3);
|
||||
if (attr && s_editMode>0) {
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.frsky.rssiAlarms[alarm].value, -30, 30);
|
||||
}
|
||||
if (warning)
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.rssiAlarms.warning, -30, 30);
|
||||
else
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.rssiAlarms.critical, -30, 30);
|
||||
}
|
||||
#else // CPUARM
|
||||
uint8_t alarm = (k-ITEM_TELEMETRY_RSSI_ALARM1);
|
||||
lcdDrawTextAlignedLeft(y, STR_ALARM);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_VALARM, ((2+alarm+g_model.frsky.rssiAlarms[alarm].level)%4), menuHorizontalPosition<=0 ? attr : 0);
|
||||
lcdDrawChar(TELEM_COL2+4*FW, y, '<');
|
||||
@@ -729,7 +734,11 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
#endif // CPUARM
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(CPUARM)
|
||||
case ITEM_TELEMETRY_DISABLE_ALARMS:
|
||||
g_model.rssiAlarms.disabled = editCheckBox(g_model.rssiAlarms.disabled, LCD_W - 10, y, STR_DISABLE_ALARM, attr, event);
|
||||
break;
|
||||
#endif
|
||||
#if !defined(CPUARM)
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
case ITEM_TELEMETRY_USR_LABEL:
|
||||
|
||||
Reference in New Issue
Block a user