標題: 基于STM32F103的MDK5_RTOS創建線程 [打印本頁] 作者: liuzhu 時間: 2015-9-10 00:38 標題: 基于STM32F103的MDK5_RTOS創建線程 前面已經正式介紹了如何建立一個帶有RTOS的工程,那么現在開始探究一下,如何在使用了RTOS的程序中建立線程。
經過查閱,發現想要創建一個線程的話,那么只要調用創建線程的函數就可以了。一下就是其 原型。
/// Create a thread and add it to Active Threads and set it tostate READY.
/// \param[in] thread_def thread definitionreferenced with \ref osThread.
/// \param[in] argument pointerthat is passed to the thread function as start argument.
/// \return thread ID for reference by other functions or NULLin case of error.
osThreadId osThreadCreate (const osThreadDef_t *thread_def,void *argument);