mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-16 18:25:10 +00:00
Default to very short updownDebounce values
This commit is contained in:
parent
8ba98ae873
commit
e1df4e19e5
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user