From 43b0c00e1106968e397961c2ee405a0fc78cb463 Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Mon, 2 Dec 2013 15:51:12 +0100 Subject: [PATCH] More pot checking - still need to find how to read the pot's position on the warning screen, the current solution only works the first time. --- radio/src/opentx.cpp | 12 ++++++++---- radio/src/translations/en.h | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index b244ca89b..a87912aae 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2175,6 +2175,9 @@ void checkSwitches() { swstate_t last_bad_switches = 0xff; swstate_t states = g_model.switchWarningStates; +#if defined(PCBTARANIS) + uint8_t bad_pots = 0, last_bad_pots = 0xff; +#endif while (1) { @@ -2196,11 +2199,13 @@ void checkSwitches() perOut(e_perout_mode_inactive_phase, 0); uint8_t potMode = g_model.nPotsToWarn >> 6; - uint8_t bad_pots = 0, last_bad_pots = 0xff; + bad_pots = 0; if(potMode) for (uint8_t i=0; i> 3)) > 2)) + if(!(g_model.nPotsToWarn & (1 << i)) && (abs(g_model.potPosition[i] - (getValue(MIXSRC_FIRST_POT+i) >> 3)) > 2)) { warn = true; + bad_pots |= (1<> 3,0); for (uint8_t i=0; i> 3)) > 2) { lcd_putc(60+i*(5*FW)+2*FW+2, 6*FH-2, g_model.potPosition[i] > (getValue(MIXSRC_FIRST_POT+i) >> 3) ? 127 : 126); flags = INVERS; - bad_pots |= (1<