Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
RTOS-Setup/src/tasks.cpp@22:ef8aa9728013, 2014-05-08 (annotated)
- 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?
User | Revision | Line number | New 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 | } |