Ian Hua / Quadcopter-mbedRTOS
Revision:
3:605fbcb54e75
Parent:
2:ab967d7b4346
Child:
21:b642c18eccd1
--- a/RTOS-Setup/src/tasks.cpp	Tue Apr 29 11:43:32 2014 +0000
+++ b/RTOS-Setup/src/tasks.cpp	Tue Apr 29 14:53:32 2014 +0000
@@ -1,8 +1,20 @@
 #include "tasks.h"
 #include "setup.h"
 
-void ledReset(void)
+void createThreads(void)
 {
-    for (int i = 0; i < 4; i++)
-        LED[i] = 0;
+    /* Create threads */
+    RtosTimer thread1(Task1, osTimerPeriodic, NULL);
+    RtosTimer thread2(Task2, osTimerPeriodic, NULL);
+    RtosTimer thread3(Task3, osTimerPeriodic, (void *)0);
+    RtosTimer thread4(Task4, osTimerPeriodic, (void *)0);
+
+    /* Start threads */
+    thread1.start(TASK1_PERIOD);
+    thread2.start(TASK2_PERIOD);
+    thread3.start(TASK3_PERIOD);
+    thread4.start(TASK4_PERIOD);
+    
+    /* Execute state machine forever */
+    Thread::wait(osWaitForever);
 }