zl程序教程

您现在的位置是:首页 >  其他

当前栏目

ESP32 项目编译 多处esp_log.h 错误的解决

错误log项目 解决 编译 ESP32 ESP
2023-09-11 14:21:25 时间

在ESP32项目进行编译的时候,有时候会出现多个esp_log.h相关的错误,包括in expansion of macro 'LOG_COLOR' in expansion of macro 'LOG_COLOR_W' in expansion of macro 'ESP_LOGE' in expansion of macro 'ESP_LOG_LEVEL_LOCAL' in expansion of macro 'LOG_FORMAT' in expansion of macro 'LOG_COLOR_E' ``in expansion of macro 'ESP_LOG_LEVEL' in expansion of macro 'LOG_COLOR'等处的note。
在这里插入图片描述在这里插入图片描述
这类问题主要还是看业务代码相关部分,由于参数错误或者参数个数错误导致。
我们仔细查看错误代码,发现:
ESP_LOGE(TAG, "rrpc,gettime ERROR, Time String from UART1:%s:%s",app_time_str);
格式化输出参数多了一个%s,修正以后问题解决。