X7 switch warning, take 2 (#4428)

* More like X9 proposal

* There's no E

* Fixes for compatibility
This commit is contained in:
3djc
2017-02-08 16:42:42 +01:00
committed by Bertrand Songis
parent dc9129e6f1
commit ed6a74c2c6
+20 -2
View File
@@ -483,6 +483,11 @@ void menuModelSetup(event_t event)
g_model.switchWarningState = switches_states;
AUDIO_WARNING1();
storageDirty(EE_MODEL);
#elif defined(PCBX7)
getMovedSwitch();
g_model.switchWarningState = switches_states;
AUDIO_WARNING1();
storageDirty(EE_MODEL);
#else
if (menuHorizontalPosition == NUM_SWITCHES-1) {
START_NO_HIGHLIGHT();
@@ -499,7 +504,7 @@ void menuModelSetup(event_t event)
}
LcdFlags line = attr;
#if !defined(PCBX7)
for (uint8_t i=0; i<NUM_SWITCHES-1/*not on TRN switch*/; i++) {
uint8_t swactive = !(g_model.switchWarningEnable & 1 << i);
attr = 0;
@@ -515,7 +520,7 @@ void menuModelSetup(event_t event)
states >>= 1;
}
if (line && (menuHorizontalPosition == i)) {
attr = BLINK | INVERS;
attr = BLINK | INVERS;
}
#if defined(CPUARM)
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+i*FW, y, (swactive) ? c : '-', attr);
@@ -526,6 +531,19 @@ void menuModelSetup(event_t event)
lcdDrawText(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, PSTR("<]"), (menuHorizontalPosition == NUM_SWITCHES-1 && !NO_HIGHLIGHT()) ? line : 0);
#endif
}
#else // !PCBX7
int current = 0;
for (int i=0; i<NUM_SWITCHES-1; i++) {
if (SWITCH_WARNING_ALLOWED(i)) {
uint8_t swactive = !(g_model.switchWarningEnable & (1<<i));
c = "\300-\301"[states & 0x03];
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+(2*FW*i), y, (i < 4 ? 'A'+i : 'B'+i), line && (menuHorizontalPosition==current) ? INVERS : 0);
if (swactive) lcdDrawChar(lcdNextPos, y, c);
++current;
}
states >>= 2;
}
#endif // !PCBX7
break;
}