Example software for a Cyclic Executive
Dependencies: MCP23017 SDFileSystem WattBob_TextLCD mbed
Tasks.h@1:221d677fe0d3, 2016-02-15 (annotated)
- Committer:
- sk398
- Date:
- Mon Feb 15 22:17:47 2016 +0000
- Revision:
- 1:221d677fe0d3
- Parent:
- 0:5989ac10c4d3
- Child:
- 2:22ebabd78084
Converted to a single header file and .cpp file with all the associated tasks contained.; ; This will be adapted throughout developing the tasks independently, using OO principles.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sk398 | 1:221d677fe0d3 | 1 | #ifndef _TASKS_H_ |
sk398 | 1:221d677fe0d3 | 2 | #define _TASKS_H_ |
sk398 | 1:221d677fe0d3 | 3 | |
sk398 | 1:221d677fe0d3 | 4 | #define HIGH 1 |
sk398 | 1:221d677fe0d3 | 5 | #define LOW 0 |
sk398 | 1:221d677fe0d3 | 6 | |
sk398 | 1:221d677fe0d3 | 7 | #define WATCHDOG_PULSE_WIDTH 15 |
sk398 | 1:221d677fe0d3 | 8 | |
sk398 | 1:221d677fe0d3 | 9 | |
sk398 | 1:221d677fe0d3 | 10 | /* ==================================== Task 1 ==================================== */ |
sk398 | 1:221d677fe0d3 | 11 | class Task1 |
sk398 | 1:221d677fe0d3 | 12 | { |
sk398 | 1:221d677fe0d3 | 13 | public: |
sk398 | 1:221d677fe0d3 | 14 | Task1(PinName squareWaveInPin); |
sk398 | 1:221d677fe0d3 | 15 | int MeasureFreq(); |
sk398 | 1:221d677fe0d3 | 16 | |
sk398 | 1:221d677fe0d3 | 17 | private: |
sk398 | 1:221d677fe0d3 | 18 | |
sk398 | 1:221d677fe0d3 | 19 | DigitalIn *_squareWaveIn; |
sk398 | 1:221d677fe0d3 | 20 | |
sk398 | 1:221d677fe0d3 | 21 | }; |
sk398 | 1:221d677fe0d3 | 22 | |
sk398 | 1:221d677fe0d3 | 23 | |
sk398 | 1:221d677fe0d3 | 24 | /* ==================================== Task 2 ==================================== */ |
sk398 | 1:221d677fe0d3 | 25 | class Task2 |
sk398 | 1:221d677fe0d3 | 26 | { |
sk398 | 1:221d677fe0d3 | 27 | public: |
sk398 | 1:221d677fe0d3 | 28 | Task2(PinName digitalInCheckPin); |
sk398 | 1:221d677fe0d3 | 29 | |
sk398 | 1:221d677fe0d3 | 30 | private: |
sk398 | 1:221d677fe0d3 | 31 | |
sk398 | 1:221d677fe0d3 | 32 | DigitalIn *_digitalInCheck; |
sk398 | 1:221d677fe0d3 | 33 | |
sk398 | 1:221d677fe0d3 | 34 | }; |
sk398 | 1:221d677fe0d3 | 35 | |
sk398 | 1:221d677fe0d3 | 36 | |
sk398 | 1:221d677fe0d3 | 37 | /* ==================================== Task 3 ==================================== */ |
sk398 | 1:221d677fe0d3 | 38 | class Task3 |
sk398 | 1:221d677fe0d3 | 39 | { |
sk398 | 1:221d677fe0d3 | 40 | public: |
sk398 | 1:221d677fe0d3 | 41 | Task3(PinName WatchdogPin); |
sk398 | 1:221d677fe0d3 | 42 | void OutputWatchdogPulse(); |
sk398 | 1:221d677fe0d3 | 43 | |
sk398 | 1:221d677fe0d3 | 44 | private: |
sk398 | 1:221d677fe0d3 | 45 | DigitalOut *_Watchdog; |
sk398 | 1:221d677fe0d3 | 46 | }; |
sk398 | 1:221d677fe0d3 | 47 | |
sk398 | 1:221d677fe0d3 | 48 | |
sk398 | 1:221d677fe0d3 | 49 | /* ==================================== Task 4 ==================================== */ |
sk398 | 1:221d677fe0d3 | 50 | |
sk398 | 1:221d677fe0d3 | 51 | |
sk398 | 1:221d677fe0d3 | 52 | /* ==================================== Task 5 ==================================== */ |
sk398 | 1:221d677fe0d3 | 53 | |
sk398 | 1:221d677fe0d3 | 54 | #endif |