From 429007b349917b7b2e983a6e8f74583e73bb8d71 Mon Sep 17 00:00:00 2001 From: E2D Date: Fri, 14 Mar 2025 23:17:13 +0800 Subject: [PATCH] Buzzer bug fixed. (#1081) * Adjusted buzzer initialization logic to support ESP-IDF 5.1.1, added conditional compilation to be compatible with older versions * Update buzzer.cpp --- esp3d/src/modules/buzzer/buzzer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/esp3d/src/modules/buzzer/buzzer.cpp b/esp3d/src/modules/buzzer/buzzer.cpp index 1ead8682..47786b4b 100644 --- a/esp3d/src/modules/buzzer/buzzer.cpp +++ b/esp3d/src/modules/buzzer/buzzer.cpp @@ -54,9 +54,8 @@ bool BuzzerDevice::begin() { end(); } #if defined(ARDUINO_ARCH_ESP32) - setToneChannel(0); - ledcSetup(0, 12000, 8); -#endif // defined(ARDUINO_ARCH_ESP32) + ledcAttachChannel(0, 12000, 8, 0); +#endif // defined(ARDUINO_ARCH_ESP32) if (ESP3DSettings::readByte(ESP_BUZZER) == 1) { _started = true; playsound(5000, 240);