/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: 2013-03-31 17:07:36 UTC
  • Revision ID: tim@ed.am-20130331170736-hphm2hg0y6l7w6z1
made rtc-test's DS1307 library a symlink to the main one in src/util

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
 
64
71
protected:
65
72
 
66
73
        /** pin */
67
74
        int _pin;
68
75
 
69
 
        /** current state */
 
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 */
70
83
        bool _state;
71
84
 
72
 
        /** time when current state began */
73
 
        unsigned long _state_millis;
 
85
        /** time when the accepted state began */
 
86
        unsigned long _millis_state;
74
87
 
75
 
        /** milliseconds that have been accountred for (in terms of
76
 
         * triggering events) since current state began */
77
 
        unsigned long _state_duration_done;
 
88
        /** amount of time that we've already triggered events for this press */
 
89
        unsigned long _millis_done;
78
90
 
79
91
        /** pointer to event times */
80
92
        int *_event_times;
81
93
 
82
94
        /** pending event */
83
95
        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
 
 
91
96
};
92
97
 
93
98