mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 09:15:38 +03:00
[X9D+] S3 not available if disabled in HARDWARE menu
This commit is contained in:
parent
7100eb990e
commit
04651784b5
3 changed files with 17 additions and 26 deletions
|
@ -905,8 +905,8 @@ PACK(struct TrainerData {
|
||||||
#endif
|
#endif
|
||||||
#define EXTRA_GENERAL_FIELDS \
|
#define EXTRA_GENERAL_FIELDS \
|
||||||
EXTRA_GENERAL_FIELDS_ARM \
|
EXTRA_GENERAL_FIELDS_ARM \
|
||||||
uint8_t serial2Mode:6; \
|
uint8_t serial2Mode:4; \
|
||||||
uint8_t slidersConfig:2; \
|
uint8_t slidersConfig:4; \
|
||||||
uint8_t potsConfig; /* two bits per pot */\
|
uint8_t potsConfig; /* two bits per pot */\
|
||||||
uint8_t backlightColor; \
|
uint8_t backlightColor; \
|
||||||
swarnstate_t switchUnlockStates; \
|
swarnstate_t switchUnlockStates; \
|
||||||
|
|
|
@ -299,35 +299,26 @@
|
||||||
|
|
||||||
void memswap(void * a, void * b, uint8_t size);
|
void memswap(void * a, void * b, uint8_t size);
|
||||||
|
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
|
#define POT_CONFIG(x) ((g_eeGeneral.potsConfig >> (2*((x)-POT1)))&0x03)
|
||||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
#define IS_POT_MULTIPOS(x) (IS_POT(x) && POT_CONFIG(x)==POT_MULTIPOS_SWITCH)
|
||||||
|
#define IS_POT_WITHOUT_DETENT(x) (IS_POT(x) && POT_CONFIG(x)==POT_WITHOUT_DETENT)
|
||||||
|
#define IS_SLIDER_AVAILABLE(x) ((x) == SLIDER1 || (x) == SLIDER2 || (IS_SLIDER(x) && (g_eeGeneral.slidersConfig & (0x01 << ((x)-SLIDER1)))))
|
||||||
|
#define IS_POT_AVAILABLE(x) (IS_POT(x) && POT_CONFIG(x)!=POT_NONE)
|
||||||
|
#define IS_POT_OR_SLIDER_AVAILABLE(x) (IS_POT_AVAILABLE(x) || IS_SLIDER_AVAILABLE(x))
|
||||||
|
#define IS_MULTIPOS_CALIBRATED(cal) (cal->count>0 && cal->count<XPOTS_MULTIPOS_COUNT)
|
||||||
#elif defined(PCBFLAMENCO)
|
#elif defined(PCBFLAMENCO)
|
||||||
#define IS_POT_MULTIPOS(x) (false)
|
#define IS_POT_MULTIPOS(x) (false)
|
||||||
#define IS_POT_WITHOUT_DETENT(x) (false)
|
#define IS_POT_WITHOUT_DETENT(x) (false)
|
||||||
#elif defined(PCBX9E)
|
#define IS_POT_OR_SLIDER_AVAILABLE(x) (true)
|
||||||
#define IS_SLIDER_AVAILABLE(x) ((x)==SLIDER1 || (x)==SLIDER2 || (g_eeGeneral.slidersConfig & (0x01 << ((x)-SLIDER3))))
|
#define IS_MULTIPOS_CALIBRATED(cal) (false)
|
||||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
|
|
||||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
|
||||||
#elif defined(PCBX9DP)
|
|
||||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
|
|
||||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
|
||||||
#elif defined(PCBTARANIS)
|
|
||||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
|
|
||||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
|
||||||
#else
|
#else
|
||||||
#define IS_POT_MULTIPOS(x) (false)
|
#define IS_POT_MULTIPOS(x) (false)
|
||||||
#define IS_POT_WITHOUT_DETENT(x) (true)
|
#define IS_POT_WITHOUT_DETENT(x) (true)
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
#define IS_POT_OR_SLIDER_AVAILABLE(x) (IS_POT(x) || IS_SLIDER(x))
|
|
||||||
#else
|
|
||||||
#define IS_POT_OR_SLIDER_AVAILABLE(x) (true)
|
#define IS_POT_OR_SLIDER_AVAILABLE(x) (true)
|
||||||
|
#define IS_MULTIPOS_CALIBRATED(cal) (false)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IS_MULTIPOS_CALIBRATED(cal) (cal->count>0 && cal->count<XPOTS_MULTIPOS_COUNT)
|
|
||||||
|
|
||||||
#if defined(PCBFLAMENCO) || defined(PCBHORUS) || defined(PCBX9E) || defined(PCBX7D)
|
#if defined(PCBFLAMENCO) || defined(PCBHORUS) || defined(PCBX9E) || defined(PCBX7D)
|
||||||
#define PWR_BUTTON_DELAY
|
#define PWR_BUTTON_DELAY
|
||||||
#define PWR_PRESS_SHUTDOWN 300 // 3s
|
#define PWR_PRESS_SHUTDOWN 300 // 3s
|
||||||
|
|
|
@ -760,10 +760,10 @@ PACK(typedef struct {
|
||||||
int8_t varioRepeat;
|
int8_t varioRepeat;
|
||||||
int8_t backgroundVolume;
|
int8_t backgroundVolume;
|
||||||
|
|
||||||
TARANIS_FIELD(uint8_t serial2Mode : 6)
|
TARANIS_FIELD(uint8_t serial2Mode:6)
|
||||||
TARANIS_FIELD(uint8_t slidersConfig : 2)
|
TARANIS_FIELD(uint8_t slidersConfig:2)
|
||||||
TARANIS_FIELD(uint8_t potsConfig)
|
TARANIS_FIELD(uint8_t potsConfig)
|
||||||
TARANIS_FIELD(uint8_t backlightColor)
|
TARANIS_FIELD(uint8_t backlightColor)
|
||||||
TARANIS_FIELD(swarnstate_t switchUnlockStates)
|
TARANIS_FIELD(swarnstate_t switchUnlockStates)
|
||||||
TARANIS_FIELD(CustomFunctionData_v216 customFn[MAX_SPECIAL_FUNCTIONS])
|
TARANIS_FIELD(CustomFunctionData_v216 customFn[MAX_SPECIAL_FUNCTIONS])
|
||||||
TARANIS_FIELD(swconfig_t switchConfig)
|
TARANIS_FIELD(swconfig_t switchConfig)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue