»
(008) CubeIDE Implementation of USB Peripherals*
(018) C99 pointer*
(019) C99 With only value assignment*
(022) POSIX pthread multi-threads mutex*
(023) POSIX pthread multi-threads programming*
(027) C99 time and wait*
(028) High-precision calculation with GMP*
(029) Web Service Lib*
(030) International Components for Unicode (ICU)*
(031) Performance of C is higher than C++, because...*
🕹️(002) functions for multi-thread in FreeRTOS
FreeRTOS主要函数:
/* 用于保存句柄 */
TaskHandle_t xHandle = NULL;
/* 创建任务 */
BaseType_t xReturned = xTaskCreate(
function_name, /*任务函数void (*)(void *)*/
"Task function1", /*任务名称*/
128, /*此任务的栈的深度:给此任务分配的栈的大小除以4,单位:字节*/
(void *) param_struct, /*传递给function的参数*/
tskIDLE_PRIORITY, /*创建任务的优先级:空闲任务的优先级*/
&xHandle /*传出:任务句柄,此参数可以为NULL*/
);
xReturned==pdPASS表示创建成功
vTaskStartScheduler();/*开始任务调度*/
任务名称的最大长度在FreeRTOSConfig.h中修改:
#define configMAX_TASK_NAME_LEN 32