Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of frdm_echo by
PushButtons.h@15:a32db434af65, 2014-04-25 (annotated)
- Committer:
- silverpanda
- Date:
- Fri Apr 25 16:22:54 2014 +0000
- Revision:
- 15:a32db434af65
- Parent:
- 13:019e24491f32
debugged
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
silverpanda | 13:019e24491f32 | 1 | #ifndef pushbuttons_h__ |
silverpanda | 13:019e24491f32 | 2 | #define pushbuttons_h__ |
silverpanda | 13:019e24491f32 | 3 | |
silverpanda | 13:019e24491f32 | 4 | typedef enum {pb2 = 0, pb3} ePushButton; |
silverpanda | 13:019e24491f32 | 5 | |
silverpanda | 13:019e24491f32 | 6 | class PushButtons { |
silverpanda | 13:019e24491f32 | 7 | public: |
silverpanda | 13:019e24491f32 | 8 | PushButtons(); |
silverpanda | 13:019e24491f32 | 9 | bool tick10ms(); |
silverpanda | 13:019e24491f32 | 10 | bool getJustPressed(ePushButton); |
silverpanda | 13:019e24491f32 | 11 | bool getPressed(ePushButton); |
silverpanda | 13:019e24491f32 | 12 | private: |
silverpanda | 13:019e24491f32 | 13 | void reset(ePushButton); |
silverpanda | 13:019e24491f32 | 14 | void process(ePushButton); |
silverpanda | 13:019e24491f32 | 15 | DigitalIn *getPointer(ePushButton); |
silverpanda | 13:019e24491f32 | 16 | |
silverpanda | 13:019e24491f32 | 17 | DigitalIn *sw2, *sw3; |
silverpanda | 13:019e24491f32 | 18 | uint32_t timer[2]; |
silverpanda | 13:019e24491f32 | 19 | bool justPressed[2], oldPressed[2]; |
silverpanda | 13:019e24491f32 | 20 | }; |
silverpanda | 13:019e24491f32 | 21 | |
silverpanda | 13:019e24491f32 | 22 | #endif |