From 2341f5be68327e2c79b66cebaf16cf74d8229270 Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 23 Jul 2015 07:19:33 +0200 Subject: [PATCH] Fixes #2543 --- companion/src/eeprominterface.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 03f714abf5..3b1f5bfa0e 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -1060,13 +1060,13 @@ bool GeneralSettings::switchSourceAllowedTaranis(int index) const bool GeneralSettings::isPotAvailable(int index) const { - if (index<0 || index>4) return false; + if (index<0 || index>GetCurrentFirmware()->getCapability(Pots)) return false; return potConfig[index] != POT_NONE; } bool GeneralSettings::isSliderAvailable(int index) const { - if (index<0 || index>4) return false; + if (index<0 || index>GetCurrentFirmware()->getCapability(Sliders)) return false; return sliderConfig[index] != SLIDER_NONE; } @@ -1098,6 +1098,11 @@ GeneralSettings::GeneralSettings() switchConfig[6] = SWITCH_3POS; switchConfig[7] = SWITCH_TOGGLE; } + else { + for (int i=0; i<3; i++) { + potConfig[i] = POT_WITHOUT_DETENT; + } + } if (IS_ARM(board)) { speakerVolume = 12;