From 2d877d440844004dcdc010371739903236fb2469 Mon Sep 17 00:00:00 2001 From: philmoz Date: Thu, 4 Jan 2024 11:22:41 +1100 Subject: [PATCH] fix(radio): SF/GF pre #3601 not converted correctly (#4498) --- radio/src/storage/yaml/yaml_datastructs_funcs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index 0745654ef..4529e98ca 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -1600,6 +1600,10 @@ static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs, break; } + // Set 'enabled' to handle old format YAML files + // Will be updated if enabled flag is actually present + CFN_ACTIVE(cfn) = 1; + if (eat_comma) { val += l_sep; val_len -= l_sep; @@ -1615,11 +1619,9 @@ static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs, if (HAS_REPEAT_PARAM(func)) { // Check for 2 values to be parsed uint8_t l_sep = find_sep(val, val_len); - if (!l_sep) { + if (l_sep == val_len) { // only one more value - assume it is repeat read_enable_flag = false; - // Set 'enabled' - CFN_ACTIVE(cfn) = 1; } }