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@46:b11655031d24, 2014-05-17 (annotated)
- Committer:
- pHysiX
- Date:
- Sat May 17 11:57:09 2014 +0000
- Revision:
- 46:b11655031d24
- Parent:
- 31:3dde2201e54d
- Child:
- 47:89a7077a70d3
- Child:
- 48:9dbdc4144f00
Beginning to implement I2C RTOS driver
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 | 1:43f8ac7ca6d7 | 6 | #include "tasks.h" |
pHysiX | 1:43f8ac7ca6d7 | 7 | #include "setup.h" |
pHysiX | 1:43f8ac7ca6d7 | 8 | |
pHysiX | 3:605fbcb54e75 | 9 | void createThreads(void) |
pHysiX | 1:43f8ac7ca6d7 | 10 | { |
pHysiX | 3:605fbcb54e75 | 11 | /* Create threads */ |
pHysiX | 3:605fbcb54e75 | 12 | RtosTimer thread1(Task1, osTimerPeriodic, NULL); |
pHysiX | 27:18b6580eb0b1 | 13 | RtosTimer thread2Master(Task2_Master, osTimerPeriodic, NULL); |
pHysiX | 27:18b6580eb0b1 | 14 | RtosTimer thread2Slave(Task2_Slave, osTimerPeriodic, NULL); |
pHysiX | 46:b11655031d24 | 15 | RtosTimer thread3(Task3, osTimerPeriodic, NULL); |
pHysiX | 46:b11655031d24 | 16 | RtosTimer thread4(Task4, osTimerPeriodic, NULL); |
pHysiX | 3:605fbcb54e75 | 17 | |
pHysiX | 3:605fbcb54e75 | 18 | /* Start threads */ |
pHysiX | 3:605fbcb54e75 | 19 | thread1.start(TASK1_PERIOD); |
pHysiX | 27:18b6580eb0b1 | 20 | thread2Master.start(TASK2_MASTER_PERIOD); |
pHysiX | 27:18b6580eb0b1 | 21 | thread2Slave.start(TASK2_SLAVE_PERIOD); |
pHysiX | 3:605fbcb54e75 | 22 | thread3.start(TASK3_PERIOD); |
pHysiX | 3:605fbcb54e75 | 23 | thread4.start(TASK4_PERIOD); |
pHysiX | 21:b642c18eccd1 | 24 | |
pHysiX | 3:605fbcb54e75 | 25 | /* Execute state machine forever */ |
pHysiX | 3:605fbcb54e75 | 26 | Thread::wait(osWaitForever); |
pHysiX | 1:43f8ac7ca6d7 | 27 | } |