mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
formatting
This commit is contained in:
@@ -54,7 +54,7 @@ bool PButton::init(uint8_t pin, bool pullMode) {
|
||||
|
||||
#if defined(ESP32)
|
||||
pinMode(pin_, pullMode ? INPUT_PULLUP : INPUT_PULLDOWN);
|
||||
#else // esp8266 and standalone
|
||||
#else // esp8266 and standalone
|
||||
pinMode(pin_, pullMode ? INPUT_PULLUP : INPUT);
|
||||
#endif
|
||||
enabled_ = (digitalRead(pin_) == pullMode); // see if a button is connected
|
||||
|
||||
@@ -47,21 +47,21 @@ class PButton {
|
||||
bool pullMode_;
|
||||
bool enabled_;
|
||||
|
||||
bool state_; // Value read from button
|
||||
bool lastState_; // Last value of button state
|
||||
bool dblClickWaiting_; // whether we're waiting for a double click (down)
|
||||
bool dblClickOnNextUp_; // whether to register a double click on next release, or whether to wait and click
|
||||
bool singleClickOK_; // whether it's OK to do a single click
|
||||
bool state_; // Value read from button
|
||||
bool lastState_; // Last value of button state
|
||||
bool dblClickWaiting_; // whether we're waiting for a double click (down)
|
||||
bool dblClickOnNextUp_; // whether to register a double click on next release, or whether to wait and click
|
||||
bool singleClickOK_; // whether it's OK to do a single click
|
||||
|
||||
uint32_t downTime_; // time the button was pressed down
|
||||
uint32_t upTime_; // time the button was released
|
||||
uint32_t downTime_; // time the button was pressed down
|
||||
uint32_t upTime_; // time the button was released
|
||||
|
||||
bool ignoreUP_; // whether to ignore the button release because the click+hold was triggered
|
||||
bool waitForUP_; // when held, whether to wait for the up event
|
||||
bool longPressHappened_; // whether or not the hold event happened already
|
||||
bool vLongPressHappened_; // whether or not the long hold event happened already
|
||||
|
||||
bool buttonBusy_; // false if idle
|
||||
bool buttonBusy_; // false if idle
|
||||
|
||||
buttonEventHandler cb_onClick, cb_onDblClick, cb_onLongPress, cb_onVLongPress;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user