#include <inttypes.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/timers.h"
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
TimerHandle_t myTimer;
BaseType_t count = 0;
void send(void *p) {
xTimerStart(myTimer,pdMS_TO_TICKS(100));
while (1) {
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
void a1(TimerHandle_t timer){
count++;
if(count==10){
xTimerStop(myTimer,pdMS_TO_TICKS(100));
}
printf("timer:%d \n",count);
}
void app_main(void) {
myTimer = xTimerCreate("myTimer",pdMS_TO_TICKS(500),pdTRUE ,NULL,a1);
xTaskCreate(&send, "xEventGroupSetBits", 2048, NULL, configMAX_PRIORITIES-1, NULL);
return;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)