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:
parent
b31ba60f1e
commit
5989b5ee31
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue