- 自定义一一个 timer 和 task,timer 每秒向 ringbuf 写 入字符串
“abcdefg\r\n”, task 从 ringbuf 取出数据,并打印。(ringbuf 采用用其中一一个即可)
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#include "freertos/event_groups.h"
#include "rom/ets_sys.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include <assert.h>
#include "esp_partition.h"
#include "esp_log.h"
#include "freertos/ringbuf.h"
RingbufHandle_t buf_handle;
#define mainAUTO_RELOAD_TIMER_PERIOD pdMS_TO_TICKS( 1000 )
static void prvAutoReloadTimerCallback(TimerHandle_t xTimer)
{
printf("prvAutoReloadTimerCallback\n");
static char tx_item[] = "abcdefg/r/n";