Merge against latest 2.3
This commit is contained in:
+27
-27
@@ -323,6 +323,9 @@ PACK(struct VarioData {
|
||||
* Telemetry Sensor structure
|
||||
*/
|
||||
|
||||
#define TELEMETRY_ENDPOINT_NONE 0xFF
|
||||
#define TELEMETRY_ENDPOINT_SPORT 0x07
|
||||
|
||||
PACK(struct TelemetrySensor {
|
||||
union {
|
||||
uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type.
|
||||
@@ -383,18 +386,17 @@ PACK(struct TelemetrySensor {
|
||||
int32_t getPrecDivisor() const;
|
||||
bool isSameInstance(TelemetryProtocol protocol, uint8_t instance)
|
||||
{
|
||||
if (this->instance == instance)
|
||||
return true;
|
||||
|
||||
if (protocol == PROTOCOL_TELEMETRY_FRSKY_SPORT) {
|
||||
if (((this->instance ^ instance) & 0x9F) == 0) {
|
||||
if (((this->instance ^ instance) & 0x9F) == 0 && (this->instance >> 5) != TELEMETRY_ENDPOINT_SPORT && (instance >> 5) != TELEMETRY_ENDPOINT_SPORT) {
|
||||
this->instance = instance; // update the instance in case we had telemetry switching
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return this->instance == instance;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -422,16 +424,13 @@ PACK(struct TrainerModuleData {
|
||||
#define MM_RF_CUSTOM_SELECTED 0xff
|
||||
PACK(struct ModuleData {
|
||||
uint8_t type:4;
|
||||
// TODO some refactoring is needed, rfProtocol is only used by DSM2 and MULTI, it could be merged with subType
|
||||
int8_t rfProtocol:4;
|
||||
uint8_t channelsStart;
|
||||
int8_t channelsCount; // 0=8 channels
|
||||
union {
|
||||
struct {
|
||||
uint8_t failsafeMode:4; // only 3 bits used
|
||||
uint8_t subType:3;
|
||||
uint8_t invertedSerial:1; // telemetry serial inverted from standard
|
||||
};
|
||||
};
|
||||
uint8_t failsafeMode:4; // only 3 bits used
|
||||
uint8_t subType:3;
|
||||
uint8_t invertedSerial:1; // telemetry serial inverted from standard
|
||||
|
||||
union {
|
||||
uint8_t raw[PXX2_MAX_RECEIVERS_PER_MODULE * PXX2_LEN_RX_NAME + 1];
|
||||
@@ -452,10 +451,9 @@ PACK(struct ModuleData {
|
||||
NOBACKUP(struct {
|
||||
uint8_t power:2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W
|
||||
uint8_t spare1:2;
|
||||
uint8_t receiver_telem_off:1; // false = receiver telem enabled
|
||||
uint8_t receiver_channel_9_16:1; // false = pwm out 1-8, true 9-16
|
||||
uint8_t external_antenna:1; // false = internal antenna, true = external antenna
|
||||
uint8_t fast:1; // TODO: to be used later by external module (fast means serial @ high speed)
|
||||
uint8_t receiverTelemetryOff:1; // false = receiver telem enabled
|
||||
uint8_t receiverHigherChannels:1; // false = pwm out 1-8, true 9-16
|
||||
int8_t antennaMode:2;
|
||||
uint8_t spare2;
|
||||
} pxx);
|
||||
NOBACKUP(struct {
|
||||
@@ -668,7 +666,7 @@ PACK(struct TrainerData {
|
||||
#define SPLASH_MODE uint8_t splashMode:1; uint8_t splashSpare:2
|
||||
#endif
|
||||
|
||||
#if defined(PCBXLITES) || defined(PCBHORUS)
|
||||
#if defined(PCBXLITES)
|
||||
#define GYRO_FIELDS \
|
||||
int8_t gyroMax; \
|
||||
int8_t gyroOffset;
|
||||
@@ -685,13 +683,13 @@ PACK(struct TrainerData {
|
||||
NOBACKUP(char switchNames[STORAGE_NUM_SWITCHES][LEN_SWITCH_NAME]); \
|
||||
NOBACKUP(char anaNames[NUM_STICKS + STORAGE_NUM_POTS + STORAGE_NUM_SLIDERS][LEN_ANA_NAME]); \
|
||||
NOBACKUP(char currModelFilename[LEN_MODEL_FILENAME+1]); \
|
||||
NOBACKUP(uint8_t spare4:1); \
|
||||
NOBACKUP(uint8_t spare5:1); \
|
||||
NOBACKUP(uint8_t blOffBright:7); \
|
||||
NOBACKUP(char bluetoothName[LEN_BLUETOOTH_NAME]);
|
||||
#elif defined(PCBTARANIS) || defined(PCBNV14)
|
||||
#if defined(STORAGE_BLUETOOTH)
|
||||
#define BLUETOOTH_FIELDS \
|
||||
uint8_t spare4; \
|
||||
uint8_t spare5; \
|
||||
char bluetoothName[LEN_BLUETOOTH_NAME];
|
||||
#else
|
||||
#define BLUETOOTH_FIELDS
|
||||
@@ -709,7 +707,7 @@ PACK(struct TrainerData {
|
||||
#elif defined(PCBSKY9X)
|
||||
#define EXTRA_GENERAL_FIELDS \
|
||||
int8_t txCurrentCalibration; \
|
||||
int8_t spare4; \
|
||||
int8_t spare5; \
|
||||
uint8_t mAhWarn; \
|
||||
uint16_t mAhUsed; \
|
||||
int8_t temperatureCalib; \
|
||||
@@ -735,7 +733,7 @@ PACK(struct TrainerData {
|
||||
#if defined(BUZZER)
|
||||
#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)
|
||||
#else
|
||||
#define BUZZER_FIELD int8_t spare3:2
|
||||
#define BUZZER_FIELD int8_t spare4:2
|
||||
#endif
|
||||
|
||||
PACK(struct RadioData {
|
||||
@@ -747,7 +745,9 @@ PACK(struct RadioData {
|
||||
N_HORUS_FIELD(uint8_t contrast);
|
||||
NOBACKUP(uint8_t vBatWarn);
|
||||
NOBACKUP(int8_t txVoltageCalibration);
|
||||
NOBACKUP(int8_t backlightMode);
|
||||
uint8_t backlightMode:3;
|
||||
int8_t antennaMode:2;
|
||||
int8_t spare1:3;
|
||||
NOBACKUP(TrainerData trainer);
|
||||
NOBACKUP(uint8_t view); // index of view in main screen
|
||||
NOBACKUP(BUZZER_FIELD); /* 2bits */
|
||||
@@ -768,7 +768,7 @@ PACK(struct RadioData {
|
||||
NOBACKUP(uint8_t templateSetup); // RETA order for receiver channels
|
||||
NOBACKUP(int8_t PPM_Multiplier);
|
||||
NOBACKUP(int8_t hapticLength);
|
||||
N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t spare1));
|
||||
N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t spare2));
|
||||
N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t stickReverse));
|
||||
NOBACKUP(int8_t beepLength:3);
|
||||
NOBACKUP(int8_t hapticStrength:3);
|
||||
@@ -791,7 +791,7 @@ PACK(struct RadioData {
|
||||
NOBACKUP(uint8_t disableRssiPoweroffAlarm:1);
|
||||
NOBACKUP(uint8_t USBMode:2);
|
||||
NOBACKUP(uint8_t jackMode:2);
|
||||
NOBACKUP(uint8_t spare2:1);
|
||||
NOBACKUP(uint8_t spare3:1);
|
||||
NOBACKUP(char ttsLanguage[2]);
|
||||
NOBACKUP(int8_t beepVolume:4);
|
||||
NOBACKUP(int8_t wavVolume:4);
|
||||
@@ -945,7 +945,7 @@ static inline void check_struct()
|
||||
CHKSIZE(RadioData, 735);
|
||||
CHKSIZE(ModelData, 5301);
|
||||
#elif defined(PCBHORUS)
|
||||
CHKSIZE(RadioData, 883);
|
||||
CHKSIZE(RadioData, 881);
|
||||
CHKSIZE(ModelData, 9736);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user