mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 06:45:10 +03:00
[Taranis X9E] Pots and Switches full support. Removed 2x2 switches
feature
This commit is contained in:
parent
dd0d34ba14
commit
0eeb0437db
16 changed files with 318 additions and 256 deletions
|
@ -314,7 +314,7 @@ extern void boardInit();
|
|||
#if defined(REV9E)
|
||||
#define NUM_SWITCHES 18 // yes, it's a lot!
|
||||
#else
|
||||
#define NUM_SWITCHES 14 // 8 physical switches + 6 possible from 3POS
|
||||
#define NUM_SWITCHES 8
|
||||
#endif
|
||||
#define NUM_SW_SRCRAW 8
|
||||
#define SWSRC_THR SWSRC_SF2
|
||||
|
@ -362,17 +362,17 @@ enum PotType {
|
|||
};
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#define IS_POT_AVAILABLE(x) (((x)!=POT3 && (x)!=POT4) || (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)
|
||||
#define IS_POT_AVAILABLE(x) ((x)<POT1 || (x)>POT_LAST || ((g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE))
|
||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||
#elif 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)
|
||||
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE)
|
||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(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)
|
||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||
#else
|
||||
#define IS_POT_AVAILABLE(x) (true)
|
||||
#define IS_POT_MULTIPOS(x) (false)
|
||||
|
@ -382,7 +382,7 @@ enum PotType {
|
|||
#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)
|
||||
#define SAVE_POT_POSITION(i) g_model.potsWarnPosition[i] = GET_LOWRES_POT_POSITION(i)
|
||||
|
||||
#if ROTARY_ENCODERS > 0
|
||||
#define IF_ROTARY_ENCODERS(x) x,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue