chore: Remove rssiSource and use default value (#3643)

* fixes #2552

- remove edit option rssiSource
- reset rssiOption to default (none) if carried over from OpenTX conversion

* deleted rssiSource functional code Companion, simulator and radio

* forgot one commented line
This commit is contained in:
Michael
2023-06-23 13:52:54 +10:00
committed by GitHub
parent 2a3825ebe9
commit 15849956ce
10 changed files with 10 additions and 134 deletions
-18
View File
@@ -24,7 +24,6 @@
enum MenuModelTelemetryFrskyItems {
ITEM_TELEMETRY_PROTOCOL_TYPE,
ITEM_TELEMETRY_RSSI_LABEL,
ITEM_TELEMETRY_RSSI_SOURCE,
ITEM_TELEMETRY_RSSI_ALARM1,
ITEM_TELEMETRY_RSSI_ALARM2,
ITEM_TELEMETRY_DISABLE_ALARMS,
@@ -231,23 +230,6 @@ void menuModelTelemetry(event_t event)
lcdDrawTextAlignedLeft(y, getRxStatLabels()->label);
break;
case ITEM_TELEMETRY_RSSI_SOURCE: {
lcdDrawTextAlignedLeft(y, INDENT TR_SOURCE);
if (g_model.rssiSource) {
drawSource(TELEM_COL2, y, MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1), attr);
TelemetrySensor * sensor = &g_model.telemetrySensors[g_model.rssiSource - 1];
lcdDrawText(lcdNextPos, y, " ", attr);
drawReceiverName(lcdNextPos, y, sensor->frskyInstance.rxIndex >> 2, sensor->frskyInstance.rxIndex & 0x03, attr);
}
else {
lcdDrawText(TELEM_COL2, y, STR_DEFAULT, attr);
}
if (attr) {
g_model.rssiSource = checkIncDec(event, g_model.rssiSource, 0, MAX_TELEMETRY_SENSORS, EE_MODEL | NO_INCDEC_MARKS, isRssiSensorAvailable);
}
break;
}
case ITEM_TELEMETRY_RSSI_ALARM1:
case ITEM_TELEMETRY_RSSI_ALARM2:
{
-18
View File
@@ -24,7 +24,6 @@
enum MenuModelTelemetryFrskyItems {
ITEM_TELEMETRY_PROTOCOL_TYPE,
ITEM_TELEMETRY_RSSI_LABEL,
ITEM_TELEMETRY_RSSI_SOURCE,
ITEM_TELEMETRY_RSSI_ALARM1,
ITEM_TELEMETRY_RSSI_ALARM2,
ITEM_TELEMETRY_DISABLE_ALARMS,
@@ -223,23 +222,6 @@ void menuModelTelemetry(event_t event)
lcdDrawTextAlignedLeft(y, getRxStatLabels()->label);
break;
case ITEM_TELEMETRY_RSSI_SOURCE: {
lcdDrawTextAlignedLeft(y, INDENT TR_SOURCE);
if (g_model.rssiSource) {
drawSource(TELEM_COL2, y, MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1), attr);
TelemetrySensor * sensor = &g_model.telemetrySensors[g_model.rssiSource - 1];
lcdDrawText(lcdNextPos, y, " ", attr);
drawReceiverName(lcdNextPos, y, sensor->frskyInstance.rxIndex >> 2, sensor->frskyInstance.rxIndex & 0x03, attr);
}
else {
lcdDrawText(TELEM_COL2, y, STR_DEFAULT, attr);
}
if (attr) {
g_model.rssiSource = checkIncDec(event, g_model.rssiSource, 0, MAX_TELEMETRY_SENSORS, EE_MODEL | NO_INCDEC_MARKS, isRssiSensorAvailable);
}
break;
}
case ITEM_TELEMETRY_RSSI_ALARM1:
case ITEM_TELEMETRY_RSSI_ALARM2:
{
+7
View File
@@ -147,6 +147,13 @@ void postModelLoad(bool alarms)
storageDirty(EE_MODEL);
}
// fix #2552: reset rssiSource to default none (= 0)
if(g_model.rssiSource) {
g_model.rssiSource = 0;
storageDirty(EE_MODEL);
}
#if defined(PXX2)
if (is_memclear(g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID)) {
memcpy(g_model.modelRegistrationID, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID);
+2 -9
View File
@@ -277,15 +277,8 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t module, uint8_t origin, const
// in this case we don't want to update telemetryData.rssi
return;
}
if (g_model.rssiSource) {
TelemetrySensor * sensor = &g_model.telemetrySensors[g_model.rssiSource - 1];
if (sensor->isSameInstance(PROTOCOL_TELEMETRY_FRSKY_SPORT, instance)) {
telemetryData.rssi.set(data);
}
}
else {
telemetryData.rssi.set(data);
}
telemetryData.rssi.set(data);
}
else if (dataId == VALID_FRAME_RATE_ID) {
data = 100 - SPORT_DATA_U8(packet);