/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-09 20:53:26 UTC
  • Revision ID: tim@ed.am-20120509205326-23nmnh3i05hotlro
moved modes to a subdirectory

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
         */
62
62
        int get_event();
63
63
 
64
 
        /**
65
 
         * Get the current button state.
66
 
         *
67
 
         * @return true if the button is pressed
68
 
         */
69
 
        bool get_state();
70
 
 
71
64
protected:
72
65
 
73
66
        /** pin */
74
67
        int _pin;
75
68
 
76
 
        /** last real state */
77
 
        bool _last_real_state;
78
 
 
79
 
        /** time when the real state began */
80
 
        unsigned long _millis_real_state;
81
 
 
82
 
        /** accepted state */
 
69
        /** current state */
83
70
        bool _state;
84
71
 
85
 
        /** time when the accepted state began */
86
 
        unsigned long _millis_state;
 
72
        /** time when current state began */
 
73
        unsigned long _state_millis;
87
74
 
88
 
        /** amount of time that we've already triggered events for this press */
89
 
        unsigned long _millis_done;
 
75
        /** milliseconds that have been accountred for (in terms of
 
76
         * triggering events) since current state began */
 
77
        unsigned long _state_duration_done;
90
78
 
91
79
        /** pointer to event times */
92
80
        int *_event_times;
93
81
 
94
82
        /** pending event */
95
83
        int _pending_event;
 
84
 
 
85
        /** send interim presses? */
 
86
        bool _send_interim;
 
87
 
 
88
        /** when not sending interim presses, ignore the next unpress */
 
89
        bool _ignore_next_unpress;
 
90
 
96
91
};
97
92
 
98
93