From e1df4e19e5c9c1cd5670123a58b8d292af6ee237 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 21 Jun 2025 20:47:11 -0500 Subject: [PATCH] Default to very short updownDebounce values --- src/input/UpDownInterruptBase.h | 9 +++++---- src/input/UpDownInterruptImpl1.cpp | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/input/UpDownInterruptBase.h b/src/input/UpDownInterruptBase.h index d4a39a0e4..789ba2310 100644 --- a/src/input/UpDownInterruptBase.h +++ b/src/input/UpDownInterruptBase.h @@ -8,7 +8,8 @@ class UpDownInterruptBase : public Observable, public concur public: explicit UpDownInterruptBase(const char *name); void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, - input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)(), unsigned long updownDebounceMs = 300); + input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)(), + unsigned long updownDebounceMs = 50); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -27,10 +28,10 @@ class UpDownInterruptBase : public Observable, public concur input_broker_event _eventUp = INPUT_BROKER_NONE; input_broker_event _eventPressed = INPUT_BROKER_NONE; const char *_originName; - + unsigned long lastUpKeyTime = 0; unsigned long lastDownKeyTime = 0; unsigned long lastPressKeyTime = 0; - unsigned long updownDebounceMs = 300; - const unsigned long pressDebounceMs = 500; + unsigned long updownDebounceMs; + const unsigned long pressDebounceMs = 200; }; diff --git a/src/input/UpDownInterruptImpl1.cpp b/src/input/UpDownInterruptImpl1.cpp index 847724ec7..761b92348 100644 --- a/src/input/UpDownInterruptImpl1.cpp +++ b/src/input/UpDownInterruptImpl1.cpp @@ -21,9 +21,8 @@ bool UpDownInterruptImpl1::init() input_broker_event eventUp = INPUT_BROKER_UP; input_broker_event eventPressed = INPUT_BROKER_SELECT; - unsigned long debounceMs = moduleConfig.canned_message.rotary1_enabled ? 100 : 300; UpDownInterruptBase::init(pinDown, pinUp, pinPress, eventDown, eventUp, eventPressed, UpDownInterruptImpl1::handleIntDown, - UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed, debounceMs); + UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed); inputBroker->registerSource(this); return true; }