diff --git a/src/myeeprom.h b/src/myeeprom.h index 6da02c4e8..fd85d2d26 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -147,15 +147,9 @@ uint8_t spare4:2 PACK(typedef struct t_EEGeneral { uint8_t version; uint16_t variant; -#if defined(PCBX9D) - int16_t calibMid[8]; - int16_t calibSpanNeg[8]; - int16_t calibSpanPos[8]; -#else - int16_t calibMid[7]; - int16_t calibSpanNeg[7]; - int16_t calibSpanPos[7]; -#endif + int16_t calibMid[NUM_STICKS+NUM_POTS]; + int16_t calibSpanNeg[NUM_STICKS+NUM_POTS]; + int16_t calibSpanPos[NUM_STICKS+NUM_POTS]; uint16_t chkSum; int8_t currModel; uint8_t contrast; diff --git a/src/open9x.h b/src/open9x.h index 169935adb..6bc5bf28a 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -216,6 +216,22 @@ extern void boardInit(); #include #endif +#define NUM_STICKS 4 + +#if defined(PCBX9D) || defined(PCBACT) +#define NUM_SWITCHES 8 +#define IS_3POS(sw) ((sw) != 5 && (sw) != 7) +#define MAX_PSWITCH (SW_SH2-SW_SA0+1) +#define NUM_POTS 4 +#define NUM_SW_SRCRAW 8 +#else +#define NUM_SWITCHES 7 +#define IS_3POS(sw) ((sw) == 3) +#define MAX_PSWITCH (SW_TRN-SW_THR+1) // 9 physical switches +#define NUM_POTS 3 +#define NUM_SW_SRCRAW 1 +#endif + #include "myeeprom.h" #if ROTARY_ENCODERS > 0 @@ -685,22 +701,6 @@ enum CswFunctions { #define CS_VDIFF 3 #define CS_STATE(x) ((x)