/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
 
        /** last state */
70
 
        bool _state_last;
71
 
 
72
 
        /** time when this state began */
 
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 */
 
83
        bool _state;
 
84
 
 
85
        /** time when the accepted state began */
73
86
        unsigned long _millis_state;
74
87
 
75
88
        /** amount of time that we've already triggered events for this press */
80
93
 
81
94
        /** pending event */
82
95
        int _pending_event;
83
 
 
84
 
        /** an interim event buffer */
85
 
        int _interim_event;
86
 
 
87
 
        /** send interim events? */
88
 
        bool _send_interim;
89
 
 
90
 
        /** when not sending interim events, ignore the next unpress */
91
 
        bool _ignore_next_unpress;
92
 
 
93
96
};
94
97
 
95
98