From 22a7788fa373e32159a87725b3577ba4e90f7d30 Mon Sep 17 00:00:00 2001 From: jflyper Date: Tue, 24 Apr 2018 08:02:32 +0900 Subject: [PATCH] Reset beeper_frequency if valid timer is not found --- src/main/fc/config.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/fc/config.c b/src/main/fc/config.c index 40e8ab6c95..ba5f655416 100644 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -50,6 +50,7 @@ #include "io/serial.h" #include "pg/beeper.h" +#include "pg/beeper_dev.h" #include "pg/pg.h" #include "pg/pg_ids.h" @@ -356,6 +357,12 @@ static void validateAndFixConfig(void) featureClear(FEATURE_RSSI_ADC); #endif +#if defined(USE_BEEPER) + if (beeperDevConfig()->frequency && !timerGetByTag(beeperDevConfig()->ioTag, TIM_USE_BEEPER)) { + beeperDevConfigMutable()->frequency = 0; + } +#endif + #if defined(TARGET_VALIDATECONFIG) targetValidateConfiguration(); #endif