想通过一个定时器 调用task notify 的函数实现 task 每一段时间跑一次
而且 config的时候 是开了#define configUSE_TASK_NOTIFICATIONS 1
但是就是一直阻塞没有进入Msg_Process();
#include "FreeRTOS.h"
#include "semphr.h"
#include "projdefs.h"
#include "timers.h"
#include "task.h"
static TaskHandle_t task_handles;
TimerHandle_t timer_hadles;
static void timer_generate(void)
{
//10ms
xTaskNotifyGive( task_handles );
}
void task(void)
{
for (;;)
{
//阻塞等待 notify
ulTaskNotifyTake( pdTRUE, portMAX_DELAY );
Msg_Process();
}
}
void task_create(void)
{
OUT_LOG_I("task create");
xTaskCreate(task,"task",640,NULL,1,&task_handles);
//每10ms notify 一下
timer_hadles = xTimerCreate("timer", TIMER_BASE/portTICK_PERIOD_MS, pdTRUE, NULL, timer_generate);
xTimerStart(timer_hadles, 0);
}
|