cancel
Showing results for 
Search instead for 
Did you mean: 

A qustion about osThreadId?

antonius
Senior
Posted on March 28, 2017 at 05:34

Everyone,

I have a puzzle in my mind, how can I change the Id into a specific one for a different task ?

on freetos.c :

osThreadId defaultTaskHandle;
osThreadId secondTaskHandle;�?�?

on cmisis_os.h :

/// Thread ID identifies the thread (pointer to a thread control block).
/// \note CAN BE CHANGED: \b os_thread_cb is implementation specific in every CMSIS-RTOS.
typedef TaskHandle_t osThreadId;�?�?�?

How can I make, base on cmisis_os.h, ? or any suggestions ?

osThreadId1 defaultTaskHandle
osThreadId2 secondTaskHandle;�?�?

Thanks

#freertos #thread #variable
1 REPLY 1
antonius
Senior
Posted on March 28, 2017 at 05:39

I make on init, any advices ?

/* Create the thread(s) */ 
/* definition and creation of defaultTask */
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 512); 
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
/* USER CODE BEGIN RTOS_THREADS */ 
/* add threads, ... */ 
/* definition and creation of defaultTask */ 
osThreadDef(secondTask, StartSecondTask, osPriorityNormal, 0, 512); 
secondTaskHandle = osThreadCreate(osThread(secondTask), NULL);�?�?�?�?�?�?�?�?�?�?�?�?�?