Switches warning: limited display to first 5 wrong switches

This commit is contained in:
Damjan Adamic
2015-07-09 22:46:13 +02:00
parent 9133558bed
commit 449829ea70
+6 -7
View File
@@ -686,15 +686,14 @@ void checkSwitches()
swarnstate_t mask = ((swarnstate_t)0x03 << (i*2));
uint8_t attr = ((states & mask) == (switches_states & mask)) ? 0 : INVERS;
if (attr) {
if (++numWarnings < 7) {
char c = "\300-\301"[(states & mask) >> (i*2)];
putsMixerSource(x, y, MIXSRC_FIRST_SWITCH+i, attr);
lcd_putcAtt(lcdNextPos, y, c, attr);
x = lcdNextPos + 3;
}
else if (numWarnings == 7) {
if (++numWarnings > 5) {
lcd_putsAtt(x, y, "...", 0);
break;
}
char c = "\300-\301"[(states & mask) >> (i*2)];
putsMixerSource(x, y, MIXSRC_FIRST_SWITCH+i, attr);
lcd_putcAtt(lcdNextPos, y, c, attr);
x = lcdNextPos + 3;
}
}
}