1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 03:20:00 +03:00

PICO: pwm_beeper_pico add check for frequency != 0.

This commit is contained in:
Matthew Selby 2025-06-30 16:23:01 +01:00
parent b31ba60f1e
commit 5989b5ee31

View file

@ -51,8 +51,9 @@ void pwmToggleBeeper(void)
void beeperPwmInit(const ioTag_t tag, uint16_t frequency) void beeperPwmInit(const ioTag_t tag, uint16_t frequency)
{ {
// frequency should be non-zero when calling beeperPwmInit.
IO_t beeperIO = IOGetByTag(tag); IO_t beeperIO = IOGetByTag(tag);
if (beeperIO) { if (beeperIO && frequency) {
beeperGPIO = IO_GPIOPinIdx(beeperIO); beeperGPIO = IO_GPIOPinIdx(beeperIO);
IOInit(beeperIO, OWNER_BEEPER, 0); IOInit(beeperIO, OWNER_BEEPER, 0);