Fix for rssiSource

This commit is contained in:
Bertrand Songis
2019-04-29 17:23:02 +02:00
parent cbe712cdca
commit de575070d8
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -240,19 +240,20 @@ void menuModelTelemetryFrsky(event_t event)
case ITEM_TELEMETRY_RSSI_LABEL:
#if defined(MULTIMODULE)
if (telemetryProtocol == PROTOCOL_TELEMETRY_MULTIMODULE &&
g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A)
if (telemetryProtocol == PROTOCOL_TELEMETRY_MULTIMODULE && g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A)
lcdDrawTextAlignedLeft(y, "RSNR");
else
#endif
lcdDrawTextAlignedLeft(y, "RSSI");
#else
lcdDrawTextAlignedLeft(y, "RSSI");
#endif
break;
case ITEM_TELEMETRY_RSSI_SOURCE: {
lcdDrawTextAlignedLeft(y, STR_SOURCE);
drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, attr);
if (g_model.rssiSource) {
TelemetrySensor * sensor = &g_model.telemetrySensors[MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1)];
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);
}
+1 -1
View File
@@ -169,7 +169,7 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t origin, const uint8_t * packe
telemetryStreaming = TELEMETRY_TIMEOUT10ms; // reset counter only if valid packets are being detected
data = SPORT_DATA_U8(packet);
if (g_model.rssiSource) {
TelemetrySensor * sensor = & g_model.telemetrySensors[g_model.rssiSource];
TelemetrySensor * sensor = &g_model.telemetrySensors[g_model.rssiSource - 1];
if (sensor->isSameInstance(TELEM_PROTO_FRSKY_SPORT, instance)) {
telemetryData.rssi.set(data);
}