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
- Committer:
- pHysiX
- Date:
- 2014-05-19
- Revision:
- 51:04c6af4319e1
- Parent:
- 50:8a0accb23007
File content as of revision 51:04c6af4319e1:
/* File: tasks.h * Author: Trung Tin Ian HUA * Date: May 2014 * Purpose: Code to intialise and start all threads. */ #include "tasks.h" #include "setup.h" Mutex mutex_i2c; void createThreads(void) { /* Create timer callbacks */ RtosTimer thread2Slave_ISR(Task2_Slave_ISR, osTimerPeriodic, NULL); thread2Slave_ISR.start(TASK2_SLAVE_PERIOD); RtosTimer thread2Master_ISR(Task2_Master_ISR, osTimerPeriodic, NULL); thread2Master_ISR.start(TASK2_MASTER_PERIOD); RtosTimer thread3(Task3, osTimerPeriodic, NULL); thread3.start(TASK3_PERIOD); //RtosTimer thread4(Task4, osTimerPeriodic, NULL); //thread4.start(TASK4_PERIOD); /* Create threads */ Thread thread1(Task1, NULL, osPriorityIdle); Thread thread2Slave(Task2_Slave, NULL, osPriorityRealtime); Thread thread2Master(Task2_Master, NULL, osPriorityHigh); Thread thread4(Task4, NULL, osPriorityRealtime); /* Execute state machine forever */ Thread::wait(osWaitForever); }