標(biāo)題: 基于STM32F103的MDK5_RTOS創(chuàng)建線程 [打印本頁] 作者: liuzhu 時間: 2015-9-10 00:38 標(biāo)題: 基于STM32F103的MDK5_RTOS創(chuàng)建線程 前面已經(jīng)正式介紹了如何建立一個帶有RTOS的工程,那么現(xiàn)在開始探究一下,如何在使用了RTOS的程序中建立線程。
經(jīng)過查閱,發(fā)現(xiàn)想要創(chuàng)建一個線程的話,那么只要調(diào)用創(chuàng)建線程的函數(shù)就可以了。一下就是其 原型。
/// 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);