2 #include "AbstractDebouncedButton.h" 3 #include "MutilaDebug.h" 12 _threshold = threshold;
23 if (!peek) { _pushed =
false; }
29 uint32_t r = _lastOnDuration;
30 if (!peek) { _lastOnDuration = 0; }
36 return (
on() && MillisSince(_lastStateChange) > ms);
41 uint32_t now = Millis();
44 if (
on() && _repeatCount == 0) {
46 }
else if (
on() && MillisSince(_lastRepeat, now) > (_repeatCount == 1 ? initialMs : repeatMs)) {
60 uint32_t now = Millis();
66 _lastOnDuration = MillisSince(_lastStateChange, now);
68 if (_state!=newState) {
69 _lastStateChange = now;