From a31e1e9d06533521a01f8150f7b50d6c74e4c27a Mon Sep 17 00:00:00 2001 From: 3djc Date: Thu, 22 Jun 2023 08:52:45 +0200 Subject: [PATCH] reuse ! --- radio/src/datastructs.h | 12 ++++-------- radio/src/datastructs_private.h | 8 +++++--- radio/src/storage/yaml/yaml_datastructs_t8.cpp | 3 +-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 4f5b50488e8..1aa1dbe7af0 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -123,17 +123,13 @@ static inline void check_struct() CHKSIZE(RadioData, 862); CHKSIZE(ModelData, 6220); #elif defined(RADIO_TPRO) - CHKSIZE(RadioData, 846); + CHKSIZE(RadioData, 845); CHKSIZE(ModelData, 6245); #elif defined(RADIO_BOXER) - CHKSIZE(RadioData, 878); + CHKSIZE(RadioData, 877); CHKSIZE(ModelData, 6221); #elif defined(PCBX7) -#if defined(AUDIO_MUTE_GPIO) - CHKSIZE(RadioData, 869); -#else CHKSIZE(RadioData, 868); -#endif CHKSIZE(ModelData, 6220); #elif defined(PCBX9E) CHKSIZE(RadioData, 958); @@ -143,14 +139,14 @@ static inline void check_struct() CHKSIZE(ModelData, 6664); #elif defined(PCBHORUS) #if defined(PCBX10) - CHKSIZE(RadioData, 953); + CHKSIZE(RadioData, 952); CHKSIZE(ModelData, 15454); #else CHKSIZE(RadioData, 934); CHKSIZE(ModelData, 15452); #endif #elif defined(PCBNV14) - CHKSIZE(RadioData, 881); + CHKSIZE(RadioData, 880); CHKSIZE(ModelData, 15268); #endif diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index f9022ed3274..4d73e3dd532 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -940,9 +940,6 @@ PACK(struct RadioData { NOBACKUP(int8_t varioPitch CUST(r_vPitch,w_vPitch)); NOBACKUP(int8_t varioRange CUST(r_vPitch,w_vPitch)); NOBACKUP(int8_t varioRepeat); -#if defined(AUDIO_MUTE_GPIO) - NOBACKUP(uint8_t audioMuteEnable:1); -#endif CustomFunctionData customFn[MAX_SPECIAL_FUNCTIONS] FUNC(cfn_is_active); @@ -966,7 +963,12 @@ PACK(struct RadioData { #else NOBACKUP(uint8_t stickDeadZoneSpare:3 SKIP); #endif + +#if defined(AUDIO_MUTE_GPIO) + NOBACKUP(uint8_t audioMuteEnable:1); +#else NOBACKUP(uint8_t spare4:1 SKIP); +#endif #if defined(IMU) NOBACKUP(int8_t imuMax); diff --git a/radio/src/storage/yaml/yaml_datastructs_t8.cpp b/radio/src/storage/yaml/yaml_datastructs_t8.cpp index 778da06111c..32834f215dd 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t8.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t8.cpp @@ -406,7 +406,6 @@ static const struct YamlNode struct_RadioData[] = { YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ), YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ), YAML_SIGNED( "varioRepeat", 8 ), - YAML_UNSIGNED( "audioMuteEnable", 1 ), YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), @@ -426,7 +425,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "rotEncMode", 2 ), YAML_SIGNED( "uartSampleMode", 2 ), YAML_PADDING( 3 ), - YAML_PADDING( 1 ), + YAML_UNSIGNED( "audioMuteEnable", 1 ), YAML_UNSIGNED( "radioGFDisabled", 1 ), YAML_UNSIGNED( "radioTrainerDisabled", 1 ), YAML_UNSIGNED( "modelHeliDisabled", 1 ),