wip my brain close to meltdown

This commit is contained in:
3djc
2019-03-18 17:04:16 +01:00
parent 47b8680166
commit 135efd520c
+123 -67
View File
@@ -131,15 +131,17 @@ PACK(typedef struct {
uint32_t spare:4; uint32_t spare:4;
}) GVarData_v218; }) GVarData_v218;
#define MODELDATA_EXTRA_218 \ #if defined(PCBX12S)
uint8_t spare:3; \ #define MODELDATA_EXTRA_218 uint8_t spare:3;uint8_t trainerMode:3;uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1];ScriptData scriptsData[MAX_SCRIPTS];char inputNames[MAX_INPUTS][LEN_INPUT_NAME];;uint8_t potsWarnEnabled;;int8_t potsWarnPosition[NUM_POTS+NUM_SLIDERS];;
uint8_t trainerMode:3; \ #elif defined(PCBX10)
uint8_t potsWarnMode:2; \ #define MODELDATA_EXTRA_218 uint8_t spare:3;;uint8_t trainerMode:3;;uint8_t potsWarnMode:2;; ModuleData moduleData[NUM_MODULES+1];ScriptData scriptsData[MAX_SCRIPTS];;char inputNames[MAX_INPUTS][LEN_INPUT_NAME];;uint8_t potsWarnEnabled;;int8_t potsWarnPosition[NUM_POTS+NUM_SLIDERS];;uint8_t potsWarnSpares[NUM_DUMMY_ANAS];;
ModuleData moduleData[NUM_MODULES+1]; \ #elif defined(PCBTARANIS)
ScriptData scriptsData[MAX_SCRIPTS]; \ #define MODELDATA_EXTRA_218 uint8_t spare:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS+NUM_SLIDERS];
char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; \ #elif defined(PCBSKY9X)
uint8_t potsWarnEnabled; \ #define MODELDATA_EXTRA_218 uint8_t spare:6; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS+NUM_SLIDERS]; uint8_t rxBattAlarms[2];
int8_t potsWarnPosition[NUM_POTS+NUM_SLIDERS]; #else
#define MODELDATA_EXTRA_218
#endif
PACK(typedef struct { PACK(typedef struct {
ModelHeader header; ModelHeader header;
@@ -185,68 +187,122 @@ PACK(typedef struct {
TARANIS_PCBX9E_FIELD(uint8_t toplcdTimer) TARANIS_PCBX9E_FIELD(uint8_t toplcdTimer)
}) ModelData_v218; }) ModelData_v218;
#if defined(BUZZER) #define EXTRA_GENERAL_FIELDS_GENERAL_218 \
#define BUZZER_FIELD int8_t buzzerMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all (only used on AVR radios without audio hardware) uint8_t backlightBright; \
uint32_t globalTimer; \
uint8_t bluetoothBaudrate:4; \
uint8_t bluetoothMode:4; \
uint8_t countryCode; \
uint8_t imperial:1; \
uint8_t jitterFilter:1; /* 0 - active */\
uint8_t disableRssiPoweroffAlarm:1; \
uint8_t USBMode:2; \
uint8_t spareExtraArm:3; \
char ttsLanguage[2]; \
int8_t beepVolume:4; \
int8_t wavVolume:4; \
int8_t varioVolume:4; \
int8_t backgroundVolume:4; \
int8_t varioPitch; \
int8_t varioRange; \
int8_t varioRepeat; \
CustomFunctionData customFn[MAX_SPECIAL_FUNCTIONS];
#if defined(PCBHORUS)
#define EXTRA_GENERAL_FIELDS_218 \
EXTRA_GENERAL_FIELDS_GENERAL_218 \
uint8_t serial2Mode:4; \
uint8_t slidersConfig:4; \
uint32_t switchConfig; \
uint8_t potsConfig; /* two bits per pot */ \
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
char anaNames[NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_DUMMY_ANAS][LEN_ANA_NAME]; \
char currModelFilename[LEN_MODEL_FILENAME+1]; \
uint8_t spare:1; \
uint8_t blOffBright:7; \
char bluetoothName[LEN_BLUETOOTH_NAME];
#elif defined(PCBTARANIS)
#if defined(BLUETOOTH)
#define BLUETOOTH_FIELDS_218 \
uint8_t spare; \
char bluetoothName[LEN_BLUETOOTH_NAME];
#else #else
#define BUZZER_FIELD int8_t spareRadio:2; #define BLUETOOTH_FIELDS
#endif
#define EXTRA_GENERAL_FIELDS_218 \
EXTRA_GENERAL_FIELDS_GENERAL_218 \
uint8_t serial2Mode:4; \
uint8_t slidersConfig:4; \
uint8_t potsConfig; /* two bits per pot */\
uint8_t backlightColor; \
swarnstate_t switchUnlockStates; \
swconfig_t switchConfig; \
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
char anaNames[NUM_STICKS+NUM_POTS+NUM_SLIDERS][LEN_ANA_NAME]; \
BLUETOOTH_FIELDS
#elif defined(PCBSKY9X)
#define EXTRA_GENERAL_FIELDS_218 \
EXTRA_GENERAL_FIELDS_GENERAL_218 \
int8_t txCurrentCalibration; \
int8_t temperatureWarn; \
uint8_t mAhWarn; \
uint16_t mAhUsed; \
int8_t temperatureCalib; \
uint8_t optrexDisplay; \
uint8_t sticksGain; \
uint8_t rotarySteps; \
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
char anaNames[NUM_STICKS+NUM_POTS+NUM_SLIDERS][LEN_ANA_NAME];
#elif defined(CPUARM)
#define EXTRA_GENERAL_FIELDS_218 EXTRA_GENERAL_FIELDS_GENERAL_218
#elif defined(PXX)
#define EXTRA_GENERAL_FIELDS_218 uint8_t countryCode;
#else
#define EXTRA_GENERAL_FIELDS_218
#endif #endif
PACK(typedef struct { PACK(typedef struct {
uint8_t version; uint8_t version;
uint16_t variant; uint16_t variant;
CalibData calib[NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_MOUSE_ANALOGS+NUM_DUMMY_ANAS]; CalibData_v218 calib[NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_MOUSE_ANALOGS+NUM_DUMMY_ANAS];
uint16_t chkSum; uint16_t chkSum;
uint8_t vBatWarn; N_HORUS_FIELD(int8_t currModel);
int8_t txVoltageCalibration; N_HORUS_FIELD(uint8_t contrast);
int8_t backlightMode; uint8_t vBatWarn;
TrainerData trainer; int8_t txVoltageCalibration;
uint8_t view; // index of view in main screen int8_t backlightMode;
BUZZER_FIELD TrainerData_v218 trainer;
uint8_t fai:1; uint8_t view; // index of view in main screen
int8_t beepMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all BUZZER_FIELD
uint8_t alarmsFlash:1; uint8_t fai:1;
uint8_t disableMemoryWarning:1; int8_t beepMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
uint8_t disableAlarmWarning:1; uint8_t alarmsFlash:1;
uint8_t stickMode:2; uint8_t disableMemoryWarning:1;
int8_t timezone:5; uint8_t disableAlarmWarning:1;
uint8_t adjustRTC:1; uint8_t stickMode:2;
uint8_t inactivityTimer; int8_t timezone:5;
uint8_t telemetryBaudrate:3; uint8_t adjustRTC:1;
int8_t splashMode:3; uint8_t inactivityTimer;
int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all SPLASH_MODE; /* 3bits */
int8_t switchesDelay; int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
uint8_t lightAutoOff; uint8_t lightAutoOff;
uint8_t templateSetup; // RETA order for receiver channels uint8_t templateSetup; // RETA order for receiver channels
int8_t PPM_Multiplier; int8_t PPM_Multiplier;
int8_t hapticLength; int8_t hapticLength;
int8_t beepLength:3); N_HORUS_FIELD(N_TARANIS_FIELD(N_PCBSTD_FIELD(uint8_t reNavigation)));
int8_t hapticStrength:3; N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t stickReverse));
uint8_t gpsFormat:1; int8_t beepLength:3;
uint8_t unexpectedShutdown:1; int8_t hapticStrength:3;
uint8_t speakerPitch; uint8_t gpsFormat:1;
int8_t speakerVolume; uint8_t unexpectedShutdown:1;
int8_t vBatMin; uint8_t speakerPitch;
int8_t vBatMax; int8_t speakerVolume;
uint8_t backlightBright; int8_t vBatMin;
uint32_t globalTimer; int8_t vBatMax;
uint8_t bluetoothBaudrate:4;
uint8_t bluetoothMode:4; EXTRA_GENERAL_FIELDS_218
uint8_t countryCode;
uint8_t imperial:1; THEME_DATA
uint8_t jitterFilter:1; /* 0 - active */
uint8_t disableRssiPoweroffAlarm:1;
uint8_t USBMode:2;
uint8_t spareExtraArm:3;
char ttsLanguage[2];
int8_t beepVolume:4;
int8_t wavVolume:4;
int8_t varioVolume:4;
int8_t backgroundVolume:4;
int8_t varioPitch;
int8_t varioRange;
int8_t varioRepeat;
CustomFunctionData_v218 customFn[MAX_SPECIAL_FUNCTIONS];
}) RadioData_v218; }) RadioData_v218;
#endif //OPENTX_DATASTRUCTS_218_H #endif //OPENTX_DATASTRUCTS_218_H