CC3200 FreeRTOS软件定时器无法进入回调函数问题,请问有人用过FreeRTOS的软件定时器吗?我的配置如下:
/* Timer related defines. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY 2
#define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
#define configUSE_MALLOC_FAILED_HOOK 1
#define configENABLE_BACKWARD_COMPATIBILITY 1
TimerHandle_t g_softetimer = NULL;
void SoftTimerCallbackHandler( TimerHandle_t xTimer )
{
UART_PRINT("SoftTimerCallbackHandler\n\r");
GPIO_IF_LedToggle(MCU_ORANGE_LED_GPIO);
}
g_softetimer = xTimerCreate("SoftTimer", (1000*30 / portTICK_RATE_MS), pdTRUE, 0, SoftTimerCallbackHandler);
//g_softetimer = xTimerCreate("SoftTimer", 500, pdTRUE, (void *)0, SoftTimerCallbackHandler);
if(g_softetimer)
{
UART_PRINT("g_softetimer=%x\r\n", g_softetimer);
}
if(xTimerStart(g_softetimer, 0) != pdPASS)
{
UART_PRINT("xTimerStart Failure\n\r");
}
else
{
UART_PRINT("xTimerStart Success\n\r");
}
以上是我的代码,我用UART_PRINT("xTimerIsTimerActive=%x\r\n",xTimerIsTimerActive(g_softetimer));打印出来xTimerIsTimerActive=0,说明是定时器没有激活啊。但是我以上的代码调用的API函数返回状态都是没有问题的。。