Fix failsafe for channelcount = 24

This commit is contained in:
3djc
2019-04-08 13:16:44 +02:00
parent 99ad8bc2cf
commit bcaeb9764f
+7 -6
View File
@@ -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);
}
}