From dffdd2d6c5e028aac5e8a77debf18515fa346d70 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 21 Dec 2014 16:02:21 +0100 Subject: [PATCH] Fixes #1800: suppress center beep for non-existing pots --- radio/src/mixer.cpp | 4 +++- radio/src/opentx.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index f6239c2d1..32c93a162 100644 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -495,7 +495,9 @@ void evalInputs(uint8_t mode) if (tmp==0 || (tmp==1 && (bpanaCenter & mask))) { anaCenter |= mask; if ((g_model.beepANACenter & mask) && !(bpanaCenter & mask) && !calibrationState) { - AUDIO_POT_MIDDLE(i); + if (!IS_POT(i) || IS_POT_AVAILABLE(i)) { + AUDIO_POT_MIDDLE(i); + } } } } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index a81d7892e..fab5eb6a0 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -380,6 +380,8 @@ enum PotType { #define IS_POT_WITHOUT_DETENT(x) (true) #endif +#define IS_POT(x) ((x)>=POT1 && (x)<=POT_LAST) + #define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4) #define SAVE_POT_POSITION(i) g_model.potPosition[i] = GET_LOWRES_POT_POSITION(i)