From 4d32937a8bb847ed9a613e1029f07a90854722f6 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 6 Sep 2019 10:57:53 +0200 Subject: [PATCH] Display non selected RSSI source as default --- radio/src/gui/128x64/model_telemetry.cpp | 5 ++++- radio/src/gui/212x64/model_telemetry.cpp | 5 ++++- radio/src/gui/480x272/model_telemetry.cpp | 7 +++++-- radio/src/translations.cpp | 1 + radio/src/translations.h | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/radio/src/gui/128x64/model_telemetry.cpp b/radio/src/gui/128x64/model_telemetry.cpp index 04a6a26c9..e883ea8cf 100644 --- a/radio/src/gui/128x64/model_telemetry.cpp +++ b/radio/src/gui/128x64/model_telemetry.cpp @@ -247,12 +247,15 @@ void menuModelTelemetry(event_t event) case ITEM_TELEMETRY_RSSI_SOURCE: { lcdDrawTextAlignedLeft(y, INDENT TR_SOURCE); - drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, attr); if (g_model.rssiSource) { + drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, 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); } diff --git a/radio/src/gui/212x64/model_telemetry.cpp b/radio/src/gui/212x64/model_telemetry.cpp index dd82a492d..d96558047 100644 --- a/radio/src/gui/212x64/model_telemetry.cpp +++ b/radio/src/gui/212x64/model_telemetry.cpp @@ -238,12 +238,15 @@ void menuModelTelemetry(event_t event) case ITEM_TELEMETRY_RSSI_SOURCE: { lcdDrawTextAlignedLeft(y, INDENT TR_SOURCE); - drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, attr); if (g_model.rssiSource) { + drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, 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); } diff --git a/radio/src/gui/480x272/model_telemetry.cpp b/radio/src/gui/480x272/model_telemetry.cpp index 5cd57b1dc..db9281ae2 100644 --- a/radio/src/gui/480x272/model_telemetry.cpp +++ b/radio/src/gui/480x272/model_telemetry.cpp @@ -228,12 +228,15 @@ bool menuModelTelemetry(event_t event) case ITEM_TELEMETRY_RSSI_SOURCE: { lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH, y, STR_SOURCE); - drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, attr); - if (g_model.rssiSource) { + if(g_model.rssiSource) { + drawSource(TELEM_COL2, y, g_model.rssiSource ? MIXSRC_FIRST_TELEM + 3 * (g_model.rssiSource - 1) : 0, 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); +w } if (attr) { g_model.rssiSource = checkIncDec(event, g_model.rssiSource, 0, MAX_TELEMETRY_SENSORS, EE_MODEL | NO_INCDEC_MARKS, isRssiSensorAvailable); } diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index ef3c4f2a9..6c9d95752 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -124,6 +124,7 @@ const char STR_SWITCH[] = TR_SWITCH; const char STR_TRIMS[] = TR_TRIMS; const char STR_FADEIN[] = TR_FADEIN; const char STR_FADEOUT[] = TR_FADEOUT; +const char STR_DEFAULT[] = TR_DEFAULT; const char STR_CHECKTRIMS[] = TR_CHECKTRIMS; const char STR_MODE[] = TR_MODE; const char STR_NOFREEEXPO[] = TR_NOFREEEXPO; diff --git a/radio/src/translations.h b/radio/src/translations.h index 8aa3795b7..4b4564687 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -220,6 +220,7 @@ extern const char STR_SWITCH[]; extern const char STR_TRIMS[]; extern const char STR_FADEIN[]; extern const char STR_FADEOUT[]; +extern const char STR_DEFAULT[]; extern const char STR_CHECKTRIMS[]; extern const char STR_SWASHTYPE[]; extern const char STR_COLLECTIVE[];