Class that makes for easy scheduling of regular tasks in a soft real-time context.
BooleanTicker.h@0:9015010b5125, 2014-05-26 (annotated)
- Committer:
- symbiotic
- Date:
- Mon May 26 17:09:32 2014 +0000
- Revision:
- 0:9015010b5125
original version of library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
symbiotic | 0:9015010b5125 | 1 | /** |
symbiotic | 0:9015010b5125 | 2 | Generic Ticker implementation that sets a boolean flag at a regular interval |
symbiotic | 0:9015010b5125 | 3 | |
symbiotic | 0:9015010b5125 | 4 | 9/12/13 Andrew H. Fagg Original |
symbiotic | 0:9015010b5125 | 5 | |
symbiotic | 0:9015010b5125 | 6 | */ |
symbiotic | 0:9015010b5125 | 7 | |
symbiotic | 0:9015010b5125 | 8 | |
symbiotic | 0:9015010b5125 | 9 | #ifndef BOOLEAN_TICKER_H |
symbiotic | 0:9015010b5125 | 10 | #define BOOLEAN_TICKER_H |
symbiotic | 0:9015010b5125 | 11 | #include "mbed.h" |
symbiotic | 0:9015010b5125 | 12 | |
symbiotic | 0:9015010b5125 | 13 | class BooleanTicker { |
symbiotic | 0:9015010b5125 | 14 | public: |
symbiotic | 0:9015010b5125 | 15 | BooleanTicker(float interval); |
symbiotic | 0:9015010b5125 | 16 | ~BooleanTicker(); |
symbiotic | 0:9015010b5125 | 17 | void clear(); |
symbiotic | 0:9015010b5125 | 18 | void set(); |
symbiotic | 0:9015010b5125 | 19 | bool getValue(); |
symbiotic | 0:9015010b5125 | 20 | private: |
symbiotic | 0:9015010b5125 | 21 | void BooleanTickerCallback(); |
symbiotic | 0:9015010b5125 | 22 | Ticker ticker; |
symbiotic | 0:9015010b5125 | 23 | bool value; |
symbiotic | 0:9015010b5125 | 24 | |
symbiotic | 0:9015010b5125 | 25 | }; |
symbiotic | 0:9015010b5125 | 26 | |
symbiotic | 0:9015010b5125 | 27 | #endif |