使用 PlatformIO 在 ESP32 上 portTICK_PERIOD_MS 和 configTICK_RATE_HZ 的值是多少?
当你在 ESP32 上使用 PlatformIO 和 Arduino 框架的默认配置时,configTICK_RATE_HZ 设置为 1000。换句话说,FreeRTOS 的默认 tick 频率为 1kHz。这在 sdkconfig.h 中定义:
sdkconfig.h
#define CONFIG_FREERTOS_HZ 1000因此 portTICK_PERIOD_MS 为 1。在我看来,1kHz 的 tick 速率对大多数用例来说是合理的配置。
我通过在 ESP32 上使用以下代码找到了该值:
print_tick.ino
Serial.println("时序:");
Serial.println(portTICK_PERIOD_MS);
Serial.println(configTICK_RATE_HZ);Check out similar posts by category:
Arduino, Electronics, Embedded, ESP8266/ESP32, FreeRTOS, PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow