Example software for a Cyclic Executive

Dependencies:   MCP23017 SDFileSystem WattBob_TextLCD mbed

Committer:
sk398
Date:
Mon Feb 15 22:30:54 2016 +0000
Revision:
2:22ebabd78084
Parent:
1:221d677fe0d3
Child:
3:c611b9bb5770
All functional prototypes declared in header file.; Need to update class file to include constructor.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sk398 2:22ebabd78084 1 /* ###############################################################################
sk398 2:22ebabd78084 2 #
sk398 2:22ebabd78084 3 #
sk398 2:22ebabd78084 4 #
sk398 2:22ebabd78084 5 #
sk398 2:22ebabd78084 6 #
sk398 2:22ebabd78084 7 #
sk398 2:22ebabd78084 8 #
sk398 2:22ebabd78084 9 #
sk398 2:22ebabd78084 10 #
sk398 2:22ebabd78084 11 #
sk398 2:22ebabd78084 12 #
sk398 2:22ebabd78084 13 #
sk398 2:22ebabd78084 14 #
sk398 2:22ebabd78084 15 #
sk398 2:22ebabd78084 16 #
sk398 2:22ebabd78084 17 ############################################################################### */
sk398 2:22ebabd78084 18
sk398 1:221d677fe0d3 19 #include "mbed.h"
sk398 1:221d677fe0d3 20 #include "Tasks.h"
sk398 1:221d677fe0d3 21
sk398 1:221d677fe0d3 22
sk398 1:221d677fe0d3 23 /* ==================================== Task 1 ==================================== */
sk398 1:221d677fe0d3 24 Task1::Task1(PinName squareWaveInPin)
sk398 1:221d677fe0d3 25 {
sk398 1:221d677fe0d3 26 Timer Task1Timer;
sk398 1:221d677fe0d3 27 _squareWaveIn = new DigitalIn(squareWaveInPin);
sk398 1:221d677fe0d3 28 }
sk398 1:221d677fe0d3 29
sk398 1:221d677fe0d3 30 int Task1::MeasureFreq()
sk398 1:221d677fe0d3 31 {
sk398 1:221d677fe0d3 32
sk398 1:221d677fe0d3 33 }
sk398 1:221d677fe0d3 34
sk398 1:221d677fe0d3 35
sk398 1:221d677fe0d3 36 /* ==================================== Task 2 ==================================== */
sk398 1:221d677fe0d3 37
sk398 1:221d677fe0d3 38 Task2::Task2(PinName digitalInCheckPin)
sk398 1:221d677fe0d3 39 {
sk398 1:221d677fe0d3 40 _digitialInCheck = new DigitalOut(digitalInCheckPin);
sk398 1:221d677fe0d3 41 }
sk398 1:221d677fe0d3 42
sk398 1:221d677fe0d3 43
sk398 1:221d677fe0d3 44 /* ==================================== Task 3 ==================================== */
sk398 1:221d677fe0d3 45 Task3::Task3(PinName WatchdogPin)
sk398 1:221d677fe0d3 46 {
sk398 1:221d677fe0d3 47 _Watchdog = new DigitalOut(WatchdogPin);
sk398 1:221d677fe0d3 48 }
sk398 1:221d677fe0d3 49
sk398 1:221d677fe0d3 50 void Task3::OutputWatchdogPulse()
sk398 1:221d677fe0d3 51 {
sk398 1:221d677fe0d3 52 _Watchdog -> write(HIGH);
sk398 1:221d677fe0d3 53 wait_ms(WATCHDOG_PULSE_WIDTH);
sk398 1:221d677fe0d3 54 _Watchdog -> write(LOW);
sk398 1:221d677fe0d3 55 }
sk398 1:221d677fe0d3 56
sk398 1:221d677fe0d3 57
sk398 1:221d677fe0d3 58 /* ==================================== Task 4 ==================================== */