58
60
// if button has been pressed for any amount of time
61
63
// calculate new duration for this state
62
64
unsigned long duration = millis - _state_millis;
64
66
// check through events to see if the button has been
65
67
// pressed long enough to trigger one
68
71
// if this event is in the future, we can stop looking
72
75
// if this event happened since the previous update, we
78
81
// update the duration we've accounted for
79
82
_state_duration = duration;