From bcaeb9764f17ad4a63be4ec4c609441174a4a3a7 Mon Sep 17 00:00:00 2001 From: 3djc Date: Mon, 8 Apr 2019 13:16:44 +0200 Subject: [PATCH] Fix failsafe for channelcount = 24 --- radio/src/gui/128x64/model_failsafe.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/radio/src/gui/128x64/model_failsafe.cpp b/radio/src/gui/128x64/model_failsafe.cpp index 2896e8c95..abbc822ab 100644 --- a/radio/src/gui/128x64/model_failsafe.cpp +++ b/radio/src/gui/128x64/model_failsafe.cpp @@ -68,13 +68,19 @@ void menuModelFailsafe(event_t event) const coord_t x = 1; coord_t y = FH + 1; uint8_t line = (menuVerticalPosition >= sentModuleChannels(g_moduleIdx) ? 2 : 0); - uint8_t ch = (menuVerticalPosition >= 8 ? 8 : 0) + line; + uint8_t ch = (menuVerticalPosition >= 16 ? 16 : (menuVerticalPosition >= 8 ? 8 : 0)) + line; // Channels for (; line < 8; line++) { const int32_t channelValue = channelOutputs[ch+channelStart]; int32_t failsafeValue = g_model.failsafeChannels[ch]; + if (menuVerticalPosition >= sentModuleChannels(g_moduleIdx)) { + // Outputs => Failsafe + lcdDrawText(CENTER_OFS, LCD_H - (FH + 1), STR_OUTPUTS2FAILSAFE, INVERS); + break; + } + // Channel putsChn(x+1, y, ch+1, SMLSIZE); @@ -130,9 +136,4 @@ void menuModelFailsafe(event_t event) if (++ch >= sentModuleChannels(g_moduleIdx)) break; } - - if (menuVerticalPosition >= sentModuleChannels(g_moduleIdx)) { - // Outputs => Failsafe - lcdDrawText(CENTER_OFS, LCD_H - (FH + 1), STR_OUTPUTS2FAILSAFE, INVERS); - } }