From 6e282cf2461bcceadcf030a7dabf5a2331f8a2a1 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Sat, 16 Jan 2021 16:21:07 +1300 Subject: [PATCH] Reordered configuration validation to put custom target validation to the end. --- src/main/config/config.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index f8b22bb63..25d6128d2 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -574,10 +574,6 @@ static void validateAndFixConfig(void) } #endif -#if defined(TARGET_VALIDATECONFIG) - targetValidateConfiguration(); -#endif - validateAndFixRatesSettings(); // constrain the various rates settings to limits imposed by the rates type #if defined(USE_RX_MSP_OVERRIDE) @@ -601,6 +597,11 @@ static void validateAndFixConfig(void) batteryConfigMutable()->vbatmincellvoltage = VBAT_CELL_VOLTAGE_DEFAULT_MIN; batteryConfigMutable()->vbatmaxcellvoltage = VBAT_CELL_VOLTAGE_DEFAULT_MAX; } + +#if defined(TARGET_VALIDATECONFIG) + // This should be done at the end of the validation + targetValidateConfiguration(); +#endif } void validateAndFixGyroConfig(void)