Add ESP32 inverted buzzer support

This commit is contained in:
Theo Arends 2020-06-24 15:49:18 +02:00
parent f4adce5fb1
commit 5631415acd
1 changed files with 2 additions and 2 deletions

View File

@ -101,9 +101,9 @@ void BuzzerEnabledBeep(uint32_t count, uint32_t duration)
bool BuzzerPinState(void) bool BuzzerPinState(void)
{ {
if (XdrvMailbox.index == GPIO_BUZZER_INV) { if (XdrvMailbox.index == AGPIO(GPIO_BUZZER_INV)) {
Buzzer.inverted = 1; Buzzer.inverted = 1;
XdrvMailbox.index -= (GPIO_BUZZER_INV - GPIO_BUZZER); XdrvMailbox.index -= (AGPIO(GPIO_BUZZER_INV) - AGPIO(GPIO_BUZZER));
return true; return true;
} }
return false; return false;