Default to very short updownDebounce values

This commit is contained in:
Jonathan Bennett 2025-06-21 20:47:11 -05:00
parent 8ba98ae873
commit e1df4e19e5
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,8 @@ class UpDownInterruptBase : public Observable<const InputEvent *>, 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();
@ -31,6 +32,6 @@ class UpDownInterruptBase : public Observable<const InputEvent *>, public concur
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;
};

View File

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