一、中断优先级
二、cubeMX配置
三、测试代码
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { //中断程序 } void WU_Task_3(viod) { BaseType_t status; uint32_t ydd = 0; if(click_2()==1) { wu_cs--; // status = xQueueReceive(WUQueue01Handle, &buf, 0);//读取队列 // if (status == pdTRUE) // d2=1; // else // d2=0; // if(xSemaphoreTake(WUBinarySem01Handle, portMAX_DELAY ) == pdTRUE) // d2=1; // else // d2=0; // if (xSemaphoreTake(WUCountingSem01Handle, 0 ) == pdTRUE) // d2=1; // else // d2=0; // xEventGroupSetBits(eventgroup_handle, 0x02);// KEY2 按下 // ydd = ulTaskNotifyTake(pdTRUE, portMAX_DELAY); // if(ydd != 0) // Seria1_Printf("RXD:任务通知:模拟二值信号量接收成功!\r\n"); //测试程序 }参考资料:
1. FreeRTOS官方文档(https://www.freertos.org/)
2. STM32 HAL库开发手册
本文为个人学习笔记整理,仅供学习交流使用。