From da824938035cdae39df3640c49bfc634a6b410a5 Mon Sep 17 00:00:00 2001 From: TANAKA Masayuki Date: Mon, 1 Jan 2024 11:32:52 +0900 Subject: [PATCH] change(esp32): Added clearing of queue with unTone() unTone() does not stop until the queue is exhausted. Therefore, we added clearing the queue. --- cores/esp32/Tone.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/esp32/Tone.cpp b/cores/esp32/Tone.cpp index 77a254cd1d1..772b2b6bba1 100644 --- a/cores/esp32/Tone.cpp +++ b/cores/esp32/Tone.cpp @@ -95,6 +95,7 @@ void noTone(uint8_t pin){ .frequency = 0, // Ignored .duration = 0, // Ignored }; + xQueueReset(_tone_queue); // clear queue xQueueSend(_tone_queue, &tone_msg, portMAX_DELAY); } }