| 11 | }; |
| 12 | |
| 13 | class Button { |
| 14 | public: |
| 15 | Button(int pin); |
| 16 | |
| 17 | void begin(); |
| 18 | void end(); |
| 19 | |
| 20 | void inverted(bool _inverted = true); |
| 21 | |
| 22 | ButtonState getState() const; |
| 23 | |
| 24 | void setDebounceTime(unsigned long debounceTime); |
| 25 | |
| 26 | private: |
| 27 | int _pin; |
| 28 | bool _inverted = false; |
| 29 | unsigned long _lastDebounceTime; |
| 30 | unsigned long _pressStartTime; |
| 31 | unsigned long _debounceDelay = 25; |
| 32 | |
| 33 | ButtonState _buttonState = RELEASED; |
| 34 | |
| 35 | void _read_state(); |
| 36 | static void _earable_btn_read_state(); |
| 37 | }; |
| 38 | |
| 39 | extern Button earable_btn; |
| 40 |
nothing calls this directly
no outgoing calls
no test coverage detected