diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index 8b04aae29..9eef676be 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1462,6 +1462,14 @@ bool isTelemetrySourceAvailable(int source) bool isInputSourceAvailable(int source) { +#if defined(PCBTARANIS) && !defined(REVPLUS) + if (source == MIXSRC_POT3) + return false; +#endif + + if (source>=MIXSRC_Rud && source<=MIXSRC_MAX) + return true; + if (source>=MIXSRC_Rud && source<=MIXSRC_MAX) return true; diff --git a/radio/src/opentx.h b/radio/src/opentx.h index b6e3fd3e2..a3ce6fd2a 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -354,10 +354,14 @@ enum PotType { POT_TYPE_MAX=POT_TYPE_NO_DETENT }; -#if defined(PCBTARANIS) +#if defined(PCBTARANIS) && defined(REVPLUS) #define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE) #define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS) #define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT) +#elif defined(PCBTARANIS) + #define IS_POT_AVAILABLE(x) ((x)!=POT3) + #define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS) + #define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT) #else #define IS_POT_AVAILABLE(x) (true) #define IS_POT_MULTIPOS(x) (false) diff --git a/radio/src/targets/taranis/adc_driver.cpp b/radio/src/targets/taranis/adc_driver.cpp index 8648d75a5..848260edf 100644 --- a/radio/src/targets/taranis/adc_driver.cpp +++ b/radio/src/targets/taranis/adc_driver.cpp @@ -61,10 +61,12 @@ volatile uint16_t Analog_values[NUMBER_ANALOG]; -#if defined(REV4a) +#if defined(REVPLUS) const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,1,-1,1, 1}; +#elif defined(REV4a) + const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,0,-1,1, 1}; #elif !defined(REV3) - const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,1,-1,1, 1}; + const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,0,-1,1, 1}; #endif void adcInit() @@ -129,6 +131,11 @@ void adcRead() if (ana_direction[i] < 0) { Analog_values[i] = 4096-Analog_values[i]; } +#if !defined(REVPLUS) + else if (ana_direction[i] == 0) { + Analog_values[i] = 0; + } +#endif } #endif }