1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

remove beeper dependency in pwm output

This commit is contained in:
Faduf 2017-07-16 09:45:02 +02:00
parent d6b9350c74
commit 1f809048df
3 changed files with 5 additions and 7 deletions

View file

@ -480,9 +480,8 @@ void pwmToggleBeeper(void)
pwmWriteBeeper(!beeperPwm.enabled);
}
void beeperPwmInit(const beeperDevConfig_t *beeperConfig)
void beeperPwmInit(const ioTag_t tag, uint16_t frequency)
{
const ioTag_t tag = beeperConfig->ioTag;
beeperPwm.io = IOGetByTag(tag);
const timerHardware_t *timer = timerGetByTag(tag, TIM_USE_BEEPER);
if (beeperPwm.io && timer) {
@ -492,7 +491,7 @@ void beeperPwmInit(const beeperDevConfig_t *beeperConfig)
#else
IOConfigGPIO(beeperPwm.io, IOCFG_AF_PP);
#endif
freqBeep = beeperConfig->frequency;
freqBeep = frequency;
pwmOutConfig(&beeperPwm, timer, PWM_TIMER_1MHZ, PWM_TIMER_1MHZ / freqBeep, (PWM_TIMER_1MHZ / freqBeep) / 2, 0);
}
*beeperPwm.ccr = 0;