摘要: 基于ESP-IDF4.1 1 #include "freertos/FreeRTOS.h" 2 #include "freertos/task.h" 3 #include "esp_system.h" 4 #include "esp_event.h" 5 #include "esp_log.h" 6 阅读全文
posted @ 2020-11-12 23:38 kerwin cui 阅读(2977) 评论(0) 推荐(0) 编辑
摘要: 默认的事件循环是一个事件循环的系统应用发布和处理事件(例如,Wi-Fi无线事件)。 基于ESP-IDF4.1 1 #include "esp_log.h" 2 #include "freertos/FreeRTOS.h" 3 #include "freertos/task.h" 4 #include 阅读全文
posted @ 2020-11-12 19:51 kerwin cui 阅读(1347) 评论(0) 推荐(0) 编辑
摘要: 看门狗机制用于监控嵌入式系统运行并在发生不可知的软硬件故障时将系统复位。系统正常运行时,看门狗定时器溢出之前会被重置计数值,也就是“喂狗”。定时器溢出意味着无法“喂狗”,系统异常。 基于ESP-IDF4.1 1 #include <stdio.h> 2 #include <stdlib.h> 3 # 阅读全文
posted @ 2020-11-12 12:42 kerwin cui 阅读(3295) 评论(0) 推荐(0) 编辑
摘要: 基于ESP-IDF4.1 1 #include <stdio.h> 2 #include <string.h> 3 #include <unistd.h> 4 #include "esp_timer.h" 5 #include "esp_log.h" 6 #include "esp_sleep.h" 阅读全文
posted @ 2020-11-12 12:19 kerwin cui 阅读(1262) 评论(0) 推荐(0) 编辑
摘要: 尽管FreeRTOS提供了软件计时器,但这些计时器有一些限制: 最大分辨率等于RTOS滴答周期 计时器回调从低优先级任务分派 硬件计时器不受这两个限制,但是通常它们使用起来不太方便。例如,应用组件可能需要定时器事件在将来的特定时间触发,但是硬件定时器仅包含一个用于中断产生的“比较”值。这意味着需要在 阅读全文
posted @ 2020-11-12 10:58 kerwin cui 阅读(1742) 评论(0) 推荐(0) 编辑