Tested ok on X9E and HORUS dev, more test needed (#3802)

This commit is contained in:
3djc
2016-09-14 18:59:08 +02:00
committed by Bertrand Songis
parent 576c148b9c
commit 740356c4c2
+15 -2
View File
@@ -739,7 +739,7 @@ void checkSwitches()
#if defined(TELEMETRY_MOD_14051) || defined(TELEMETRY_MOD_14051_SWAPPED)
// FIXME: One getADC() call only reads one 14051 MUX input. To have all switch states updated, we need to call it MUX_MAX+1 times.
#define GETADC_COUNT (MUX_MAX+1)
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS)
#define GETADC_COUNT 1
#endif
#ifdef GETADC_COUNT
@@ -762,6 +762,19 @@ void checkSwitches()
}
}
}
if (g_model.potsWarnMode) {
evalFlightModeMixes(e_perout_mode_normal, 0);
bad_pots = 0;
for (int i=0; i<NUM_POTS+NUM_SLIDERS; i++) {
if (!IS_POT_OR_SLIDER_AVAILABLE(POT1+i)) {
continue;
}
if (!(g_model.potsWarnEnabled & (1 << i)) && (abs(g_model.potsWarnPosition[i] - GET_LOWRES_POT_POSITION(i)) > 1)) {
warn = true;
bad_pots |= (1<<i);
}
}
}
#elif defined(PCBTARANIS)
for (int i=0; i<NUM_SWITCHES; i++) {
if (SWITCH_WARNING_ALLOWED(i) && !(g_model.switchWarningEnable & (1<<i))) {
@@ -883,7 +896,7 @@ void checkSwitches()
else if (numWarnings == 6) {
lcdDrawText(x, y, "...", ALARM_COLOR);
}
x += 20;
x += 40;
#else
x = lcdNextPos + 3;
#endif