T watch pinfix (#10231)

* Minor button debugging bits

* pin0 is a pin, pin -1 means disabled
This commit is contained in:
Jonathan Bennett
2026-04-21 20:02:56 -05:00
committed by GitHub
parent 9361b85f47
commit 2b5daf2438
2 changed files with 9 additions and 3 deletions

View File

@@ -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

View File

@@ -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