Merge pull request #7899 from etracer65/fix_f1_compile

Fix F1 compile errors
This commit is contained in:
Michael Keller 2019-04-01 12:35:25 +13:00 committed by GitHub
commit c5e3a51100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -687,7 +687,11 @@ void beeperPwmInit(const ioTag_t tag, uint16_t frequency)
if (beeperIO && timer) {
beeperPwm.io = beeperIO;
IOInit(beeperPwm.io, OWNER_BEEPER, RESOURCE_INDEX(0));
#if defined(STM32F1)
IOConfigGPIO(beeperPwm.io, IOCFG_AF_PP);
#else
IOConfigGPIOAF(beeperPwm.io, IOCFG_AF_PP, timer->alternateFunction);
#endif
freqBeep = frequency;
pwmOutConfig(&beeperPwm.channel, timer, PWM_TIMER_1MHZ, PWM_TIMER_1MHZ / freqBeep, (PWM_TIMER_1MHZ / freqBeep) / 2, 0);