Tested ok on X9E and HORUS dev, more test needed (#3802)
This commit is contained in:
+15
-2
@@ -739,7 +739,7 @@ void checkSwitches()
|
|||||||
#if defined(TELEMETRY_MOD_14051) || defined(TELEMETRY_MOD_14051_SWAPPED)
|
#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.
|
// 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)
|
#define GETADC_COUNT (MUX_MAX+1)
|
||||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS)
|
||||||
#define GETADC_COUNT 1
|
#define GETADC_COUNT 1
|
||||||
#endif
|
#endif
|
||||||
#ifdef GETADC_COUNT
|
#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)
|
#elif defined(PCBTARANIS)
|
||||||
for (int i=0; i<NUM_SWITCHES; i++) {
|
for (int i=0; i<NUM_SWITCHES; i++) {
|
||||||
if (SWITCH_WARNING_ALLOWED(i) && !(g_model.switchWarningEnable & (1<<i))) {
|
if (SWITCH_WARNING_ALLOWED(i) && !(g_model.switchWarningEnable & (1<<i))) {
|
||||||
@@ -883,7 +896,7 @@ void checkSwitches()
|
|||||||
else if (numWarnings == 6) {
|
else if (numWarnings == 6) {
|
||||||
lcdDrawText(x, y, "...", ALARM_COLOR);
|
lcdDrawText(x, y, "...", ALARM_COLOR);
|
||||||
}
|
}
|
||||||
x += 20;
|
x += 40;
|
||||||
#else
|
#else
|
||||||
x = lcdNextPos + 3;
|
x = lcdNextPos + 3;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user