Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Thu May 08 10:33:43 2014 +0000
Revision:
22:ef8aa9728013
Parent:
21:b642c18eccd1
Child:
27:18b6580eb0b1
Commented and tidied entire code for release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pHysiX 22:ef8aa9728013 1 /* File: tasks.h
pHysiX 22:ef8aa9728013 2 * Author: Trung Tin Ian HUA
pHysiX 22:ef8aa9728013 3 * Date: May 2014
pHysiX 22:ef8aa9728013 4 * Purpose: Code to intialise and start all threads.
pHysiX 22:ef8aa9728013 5 */
pHysiX 22:ef8aa9728013 6
pHysiX 1:43f8ac7ca6d7 7 #include "tasks.h"
pHysiX 1:43f8ac7ca6d7 8 #include "setup.h"
pHysiX 1:43f8ac7ca6d7 9
pHysiX 3:605fbcb54e75 10 void createThreads(void)
pHysiX 1:43f8ac7ca6d7 11 {
pHysiX 3:605fbcb54e75 12 /* Create threads */
pHysiX 3:605fbcb54e75 13 RtosTimer thread1(Task1, osTimerPeriodic, NULL);
pHysiX 3:605fbcb54e75 14 RtosTimer thread2(Task2, osTimerPeriodic, NULL);
pHysiX 3:605fbcb54e75 15 RtosTimer thread3(Task3, osTimerPeriodic, (void *)0);
pHysiX 3:605fbcb54e75 16 RtosTimer thread4(Task4, osTimerPeriodic, (void *)0);
pHysiX 3:605fbcb54e75 17
pHysiX 3:605fbcb54e75 18 /* Start threads */
pHysiX 3:605fbcb54e75 19 thread1.start(TASK1_PERIOD);
pHysiX 3:605fbcb54e75 20 thread2.start(TASK2_PERIOD);
pHysiX 3:605fbcb54e75 21 thread3.start(TASK3_PERIOD);
pHysiX 3:605fbcb54e75 22 thread4.start(TASK4_PERIOD);
pHysiX 21:b642c18eccd1 23
pHysiX 3:605fbcb54e75 24 /* Execute state machine forever */
pHysiX 3:605fbcb54e75 25 Thread::wait(osWaitForever);
pHysiX 1:43f8ac7ca6d7 26 }