From 2b5daf24387d7eccdf294d10f83092c98a23fc90 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 21 Apr 2026 20:02:56 -0500 Subject: [PATCH] T watch pinfix (#10231) * Minor button debugging bits * pin0 is a pin, pin -1 means disabled --- src/input/ButtonThread.cpp | 10 ++++++++-- variants/esp32s3/t-watch-s3/variant.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index df8de4905..3b0a46e88 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -143,6 +143,10 @@ int32_t ButtonThread::runOnce() leadUpSequenceActive = false; resetLeadUpSequence(); } +#ifdef INPUT_DEBUG + if (buttonCurrentlyPressed) + LOG_WARN("Button held for %u ms", millis() - buttonPressStartTime); +#endif // Progressive lead-up sound system if (!_suppressLeadUp && buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS) { @@ -311,7 +315,8 @@ int32_t ButtonThread::runOnce() void ButtonThread::attachButtonInterrupts() { // Interrupt for user button, during normal use. Improves responsiveness. - attachInterrupt(_pinNum, _intRoutine, CHANGE); + if (_intRoutine != nullptr) + attachInterrupt(_pinNum, _intRoutine, CHANGE); } /* @@ -320,7 +325,8 @@ void ButtonThread::attachButtonInterrupts() */ void ButtonThread::detachButtonInterrupts() { - detachInterrupt(_pinNum); + if (_intRoutine != nullptr) + detachInterrupt(_pinNum); } #ifdef ARCH_ESP32 diff --git a/variants/esp32s3/t-watch-s3/variant.h b/variants/esp32s3/t-watch-s3/variant.h index df275c31d..507d6b7dc 100644 --- a/variants/esp32s3/t-watch-s3/variant.h +++ b/variants/esp32s3/t-watch-s3/variant.h @@ -39,7 +39,7 @@ #define DAC_I2S_BCK 48 #define DAC_I2S_WS 15 #define DAC_I2S_DOUT 46 -#define DAC_I2S_MCLK 0 +#define DAC_I2S_MCLK -1 #define HAS_AXP2101