For pulsed buttons, implement per-button 'timers' that independently end the pulse instead of having a 250ms delay between every single update...
This commit is contained in:
7
Button.h
7
Button.h
@ -75,6 +75,8 @@ class PulsedButton : public SwitchButton {
|
||||
protected:
|
||||
bool double_action;
|
||||
bool split;
|
||||
unsigned long release_time1;
|
||||
unsigned long release_time2;
|
||||
uint8_t vbutton2;
|
||||
};
|
||||
|
||||
@ -88,9 +90,8 @@ class EncoderButton : public Button {
|
||||
Encoder* encoder;
|
||||
long last_value;
|
||||
uint8_t vbutton2;
|
||||
unsigned long release_time1;
|
||||
unsigned long release_time2;
|
||||
};
|
||||
|
||||
// Internal use only.
|
||||
#define _BUTTON_PULSED_TYPES (BUTTON_PULSED | BUTTON_PULSED_DOUBLE_ACTION | BUTTON_PULSED_DOUBLE_ACTION_SPLIT | ENCODER_PULSED_SPLIT)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user