(ESP32)报错-portTICK_RATE_MS' undeclared

问题详情

报错提示

'portTICK_RATE_MS' undeclared (first use in this function); did you mean 'portTICK_PERIOD_MS'?

(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP

具体情况
已经引用相关头文件,并且右键后可以大概定位到具体位置

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"

(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP

ESP- IDF未正确设置

从左下角打开 ESP-IDF SDK Configuration Editor(menuconfig)
(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP
或者按 F1 后输入 ESP-IDF SDK Configuration Editor(menuconfig)
(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP

寻找菜单
Component configFreeRTOS
(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP
勾选 configENABLE_BACKWARD_COMPATIBILITY
(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP

重新编译通过
(ESP32)报错-portTICK_RATE_MS‘ undeclared-LMLPHP

06-28 04:40