Change the interrupt trigger mode from rising edge to falling edge to improve button response.

This commit is contained in:
whywilson 2025-08-28 14:31:38 +08:00
parent 2cd6344795
commit ba11d57c8f

View File

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