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
@@ -25,6 +25,7 @@ enum MenuModelTelemetryFrskyItems {
|
||||
ITEM_TELEMETRY_RSSI_LABEL,
|
||||
ITEM_TELEMETRY_RSSI_ALARM1,
|
||||
ITEM_TELEMETRY_RSSI_ALARM2,
|
||||
ITEM_TELEMETRY_DISABLE_ALARMS,
|
||||
ITEM_TELEMETRY_SENSORS_LABEL,
|
||||
ITEM_TELEMETRY_SENSOR1,
|
||||
ITEM_TELEMETRY_SENSOR2,
|
||||
@@ -85,7 +86,7 @@ enum MenuModelTelemetryFrskyItems {
|
||||
#else
|
||||
#define VARIO_ROWS
|
||||
#endif
|
||||
#define RSSI_ROWS LABEL(RSSI), 0, 0,
|
||||
#define RSSI_ROWS LABEL(RSSI), 0, 0, 0,
|
||||
#define VARIO_RANGE_ROWS 3
|
||||
#define TELEMETRY_TYPE_ROWS (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) ? (uint8_t)0 : HIDDEN_ROW,
|
||||
|
||||
@@ -526,14 +527,20 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
|
||||
case ITEM_TELEMETRY_RSSI_ALARM1:
|
||||
case ITEM_TELEMETRY_RSSI_ALARM2: {
|
||||
uint8_t alarm = k-ITEM_TELEMETRY_RSSI_ALARM1;
|
||||
lcdDrawTextAlignedLeft(y, (alarm==0 ? STR_LOWALARM : STR_CRITICALALARM));
|
||||
lcdDrawNumber(TELEM_COL2, y, getRssiAlarmValue(alarm), LEFT|attr, 3);
|
||||
bool warning = (k==ITEM_TELEMETRY_RSSI_ALARM1);
|
||||
lcdDrawTextAlignedLeft(y, (warning ? STR_LOWALARM : STR_CRITICALALARM));
|
||||
lcdDrawNumber(TELEM_COL2, y, warning? g_model.rssiAlarms.getWarningRssi() : g_model.rssiAlarms.getCriticalRssi(), LEFT|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);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ITEM_TELEMETRY_DISABLE_ALARMS:
|
||||
g_model.rssiAlarms.disabled = editCheckBox(g_model.rssiAlarms.disabled, TELEM_COL3, y, STR_DISABLE_ALARM, attr, event);
|
||||
break;
|
||||
|
||||
#if defined(VARIO)
|
||||
case ITEM_TELEMETRY_VARIO_LABEL:
|
||||
|
||||
Reference in New Issue
Block a user