/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-18 14:40:04 UTC
  • Revision ID: tim@ed.am-20120518144004-uuz2zrjmyr78wqd5
updated emacs compile command and readjusted clock shift

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
        /**
46
53
         * Update internal state (call as regularly sa possible!)
47
54
         */
48
55
        void update();
59
66
        /** pin */
60
67
        int _pin;
61
68
 
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;
 
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;
71
77
 
72
78
        /** pointer to event times */
73
79
        int *_event_times;
75
81
        /** pending event */
76
82
        int _pending_event;
77
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
 
78
93
};
79
94
 
80
95