Reset beeper_frequency if valid timer is not found

This commit is contained in:
jflyper 2018-04-24 08:02:32 +09:00
parent 37cd0404e5
commit 22a7788fa3
1 changed files with 7 additions and 0 deletions

View File

@ -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