/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/button.h

  • Committer: Tim Marston
  • Date: 2012-05-17 22:49:11 UTC
  • Revision ID: tim@ed.am-20120517224911-dbd9dtcpl14xlhi0
rewrote/fixed button event triggering code

Show diffs side-by-side

added added

removed removed

66
66
        /** pin */
67
67
        int _pin;
68
68
 
69
 
        /** current state */
70
 
        bool _state;
71
 
 
72
 
        /** time when current state began */
73
 
        unsigned long _state_millis;
74
 
 
75
 
        /** milliseconds that have been accountred for (in terms of
76
 
         * triggering events) since current state began */
77
 
        unsigned long _state_duration_done;
 
69
        /** last state */
 
70
        bool _state_last;
 
71
 
 
72
        /** time when this state began */
 
73
        unsigned long _millis_state;
 
74
 
 
75
        /** amount of time that we've already triggered events for this press */
 
76
        unsigned long _millis_done;
78
77
 
79
78
        /** pointer to event times */
80
79
        int *_event_times;
82
81
        /** pending event */
83
82
        int _pending_event;
84
83
 
85
 
        /** send interim presses? */
 
84
        /** an interim event buffer */
 
85
        int _interim_event;
 
86
 
 
87
        /** send interim events? */
86
88
        bool _send_interim;
87
89
 
88
 
        /** when not sending interim presses, ignore the next unpress */
 
90
        /** when not sending interim events, ignore the next unpress */
89
91
        bool _ignore_next_unpress;
90
92
 
91
93
};