From 311f805daeebc629ee50cdaef9c6bc2a66a89c0d Mon Sep 17 00:00:00 2001 From: philmoz Date: Sun, 14 Sep 2025 07:43:04 +1000 Subject: [PATCH] fix(radio): Flex switch config not written to radio YAML file (#6581) --- radio/src/datastructs_private.h | 2 +- radio/src/storage/yaml/yaml_datastructs_funcs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index fda89273c..39c8b159a 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -1062,7 +1062,7 @@ PACK(struct RadioData { CUST_ARRAY(slidersConfig, struct_sliderConfig, MAX_POTS, nullptr); uint8_t stickInvert SKIP; potconfig_t potsConfig ARRAY(4,struct_potConfig,nullptr); - switchDef switchConfig[MAX_SWITCHES] FUNC(switchIsActive) NO_IDX; \ + switchDef switchConfig[MAX_SWITCHES] FUNC(switchIsActive) NO_IDX; CUST_ARRAY(flexSwitches, struct_flexSwitch, MAX_FLEX_SWITCHES, flex_sw_valid); EXTRA_GENERAL_FIELDS diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index 3e8d1a35d..17a222a69 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -2497,5 +2497,5 @@ bool switchIsActive(void* user, uint8_t* data, uint32_t bitoffs) { auto tw = reinterpret_cast(user); uint16_t idx = tw->getElmts(); - return idx < switchGetMaxSwitches(); + return idx < switchGetMaxAllSwitches(); }