
Simple test program to get familiar with functionality of MBED RTOS on ST Nucleo-F411RE. Tasks for LED blinking, user button, temperature measurement with DS1620, temperature measurement with internal temperature sensor of ST32F411RE, ultrasonic distance measurement and displaying result on 16x2 TextLCD.
Dependencies: DS1620_improved TextLCD_improved mbed-rtos mbed
Diff: tsk_main.cpp
- Revision:
- 17:94c385ff2641
- Parent:
- 15:a627638edd9c
- Child:
- 18:be0130c42925
--- a/tsk_main.cpp Wed Dec 16 22:37:56 2015 +0000 +++ b/tsk_main.cpp Fri Dec 18 15:23:21 2015 +0000 @@ -6,11 +6,14 @@ #include "tsk_dist.h" #include "tsk_led.h" #include "tsk_temp.h" +#include "tsk_inttemp.h" #define TASKS_NUMBER (sizeof(taskList)/sizeof(taskList[0])) uint32_t uiCnt = 0; - +Mutex mutexDist; +Mutex mutexTemp; +Mutex mutexIntTemp; struct task_definition_struct { void(*task)(void const *args); @@ -26,11 +29,12 @@ }; static struct task_definition_struct taskList[] = { - { dist_thread, NULL, NULL, NULL, osPriorityNormal, 0, NULL, 0 }, - { temp_thread, &initDS1620Temp, NULL, NULL, osPriorityLow, 0, NULL, 0 }, - { button_thread, NULL, NULL, NULL, osPriorityNormal, 0, NULL, 0 }, - { led_thread, NULL, NULL, NULL, osPriorityNormal, 0, NULL, 0 }, - { disp_thread, &initDisplay, NULL, NULL, osPriorityNormal, 0, NULL, 0 }, +// { dist_thread, &initDist, NULL, NULL, osPriorityNormal, 100, NULL, 0 }, + { temp_thread, &initDS1620Temp, NULL, NULL, osPriorityNormal, 100, NULL, 0 }, + { inttemp_thread, &initIntTemp, NULL, NULL, osPriorityNormal, 100, NULL, 0 }, +// { button_thread, NULL, NULL, NULL, osPriorityNormal, 0, NULL, 0 }, + { led_thread, &initLed, NULL, NULL, osPriorityNormal, 100, NULL, 0 }, + { disp_thread, &initDisplay, NULL, NULL, osPriorityNormal, 100, NULL, 0 }, }; static uint32_t initTasks(void) { @@ -60,8 +64,6 @@ int main() { - Thread::wait(1000); - initTasks(); Thread::wait(osWaitForever);