From ba11d57c8f1f8461e743704cf72d8f67a6954251 Mon Sep 17 00:00:00 2001 From: whywilson Date: Thu, 28 Aug 2025 14:31:38 +0800 Subject: [PATCH] Change the interrupt trigger mode from rising edge to falling edge to improve button response. --- src/input/UpDownInterruptBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input/UpDownInterruptBase.cpp b/src/input/UpDownInterruptBase.cpp index 95e829e01..0bf0f5cd4 100644 --- a/src/input/UpDownInterruptBase.cpp +++ b/src/input/UpDownInterruptBase.cpp @@ -30,15 +30,15 @@ void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, if (!isRAK || pinPress != 0) { pinMode(pinPress, INPUT_PULLUP); - attachInterrupt(pinPress, onIntPress, RISING); + attachInterrupt(pinPress, onIntPress, FALLING); } if (!isRAK || this->_pinDown != 0) { pinMode(this->_pinDown, INPUT_PULLUP); - attachInterrupt(this->_pinDown, onIntDown, RISING); + attachInterrupt(this->_pinDown, onIntDown, FALLING); } if (!isRAK || this->_pinUp != 0) { pinMode(this->_pinUp, INPUT_PULLUP); - attachInterrupt(this->_pinUp, onIntUp, RISING); + attachInterrupt(this->_pinUp, onIntUp, FALLING); } LOG_DEBUG("Up/down/press GPIO initialized (%d, %d, %d)", this->_pinUp, this->_pinDown, pinPress);