![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Pont Architecture Time Triggered OS
main.cpp@0:823a9a4db739, 2011-10-27 (annotated)
- Committer:
- Lachrymosa
- Date:
- Thu Oct 27 22:01:30 2011 +0000
- Revision:
- 0:823a9a4db739
Incomplete Time Triggered OS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Lachrymosa | 0:823a9a4db739 | 1 | #include "mbed.h" |
Lachrymosa | 0:823a9a4db739 | 2 | //#include "ITG3200.h" |
Lachrymosa | 0:823a9a4db739 | 3 | Serial debug(USBTX, USBRX); // tx, rx |
Lachrymosa | 0:823a9a4db739 | 4 | //#include "Debug.h" |
Lachrymosa | 0:823a9a4db739 | 5 | //#include "Globals.h" |
Lachrymosa | 0:823a9a4db739 | 6 | #include "Constants.h" |
Lachrymosa | 0:823a9a4db739 | 7 | #include "Ledtask.h" |
Lachrymosa | 0:823a9a4db739 | 8 | //#include "Ledtask.c" |
Lachrymosa | 0:823a9a4db739 | 9 | //#include "Gyrotask.h" |
Lachrymosa | 0:823a9a4db739 | 10 | //#include "Gyrotask.c" |
Lachrymosa | 0:823a9a4db739 | 11 | #include "OS.h" |
Lachrymosa | 0:823a9a4db739 | 12 | //#include "OS.c" |
Lachrymosa | 0:823a9a4db739 | 13 | |
Lachrymosa | 0:823a9a4db739 | 14 | |
Lachrymosa | 0:823a9a4db739 | 15 | Ticker interrupt; |
Lachrymosa | 0:823a9a4db739 | 16 | |
Lachrymosa | 0:823a9a4db739 | 17 | |
Lachrymosa | 0:823a9a4db739 | 18 | int main() |
Lachrymosa | 0:823a9a4db739 | 19 | { |
Lachrymosa | 0:823a9a4db739 | 20 | debug.printf("ticker start"); |
Lachrymosa | 0:823a9a4db739 | 21 | void Led1Init(); |
Lachrymosa | 0:823a9a4db739 | 22 | debug.printf("LED1InitComplete \n \r"); |
Lachrymosa | 0:823a9a4db739 | 23 | interrupt.attach(&SCHUpdate, 1); //Starting up the ticker for SCHUpdate. |
Lachrymosa | 0:823a9a4db739 | 24 | debug.printf("Interrupt Started \n \r"); |
Lachrymosa | 0:823a9a4db739 | 25 | SCHAddTask(Led1Run,1,1); //adding our LED task. |
Lachrymosa | 0:823a9a4db739 | 26 | //SCHAddTask(Gyrotask,0.2,0.2); //adding the Gyro Task. |
Lachrymosa | 0:823a9a4db739 | 27 | debug.printf("Task Added \n \r"); |
Lachrymosa | 0:823a9a4db739 | 28 | |
Lachrymosa | 0:823a9a4db739 | 29 | while(1) |
Lachrymosa | 0:823a9a4db739 | 30 | { |
Lachrymosa | 0:823a9a4db739 | 31 | SCHDispatch(); |
Lachrymosa | 0:823a9a4db739 | 32 | } |
Lachrymosa | 0:823a9a4db739 | 33 | } |
Lachrymosa | 0:823a9a4db739 | 34 |