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