/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-03-10 13:04:29 UTC
  • Revision ID: tim@ed.am-20120310130429-310w5ejo968mc6mo
cleaned-up notes

Show diffs side-by-side

added added

removed removed

43
43
        void set_event_times( int *event_times );
44
44
 
45
45
        /**
46
 
         * Set button press mode
47
 
         *
48
 
         * @param send_interim send interim presses during a long press?
49
 
         */
50
 
        void set_press_mode( bool send_interim );
51
 
 
52
 
        /**
53
46
         * Update internal state (call as regularly sa possible!)
54
47
         */
55
48
        void update();
66
59
        /** pin */
67
60
        int _pin;
68
61
 
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;
 
62
        /** current state */
 
63
        bool _state;
 
64
 
 
65
        /** time when current state began */
 
66
        unsigned long _state_millis;
 
67
 
 
68
        /** milliseconds that have been accountred for (in terms of
 
69
         * triggering events) since current state began */
 
70
        unsigned long _state_duration;
77
71
 
78
72
        /** pointer to event times */
79
73
        int *_event_times;
81
75
        /** pending event */
82
76
        int _pending_event;
83
77
 
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
78
};
94
79
 
95
80