完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在espidf的example里,复制了一个工程出来,自己添加了comments文件夹,将example中softAP代码添加到组件里。
Code: Select all ESP_LOGI(TAG, "station "MACSTR" leave, AID=%d", MAC2STR(event->mac), event->aid); 这句编译时报错。 目录结构是: Code: Select all . ├── CMakeLists.txt ├── README.md ├── components │ ├── README.md │ ├── http_server │ │ ├── CMakeLists.txt │ │ ├── html │ │ │ ├── jquery.min.js.gz │ │ │ └── web.html.gz │ │ ├── web_server.c │ │ └── web_server.h │ └── softAP │ ├── CMakeLists.txt │ ├── Kconfig.projbuild │ ├── soft_ap.c │ └── soft_ap.h ├── main │ ├── CMakeLists.txt │ ├── Kconfig.projbuild │ ├── nmea_parser.c │ ├── nmea_parser.h │ └── nmea_parser_example_main.c ├── sdkconfig └── sdkconfig.old 5 directories, 19 files 当components下只有softAP组件时能编译通过,添加了http_server组件就会报错。 具体报错如下: Code: Select all In file included from ../components/softAP/soft_ap.c:15: ../components/softAP/soft_ap.c: In function 'wifi_event_handler': ../components/softAP/soft_ap.c:44:33: error: expected ')' before 'MACSTR' ESP_LOGI(TAG, "station "MACSTR" join, AID=%d", ^~~~~~ /home/tommy/esp_s3/esp-idf/components/log/include/esp_log.h:281:79: note: in definition of macro 'LOG_FORMAT' #define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%u) %s: " format LOG_RESET_COLOR "n" ^~~~~~ /home/tommy/esp_s3/esp-idf/components/log/include/esp_log.h:431:41: note: in expansion of macro 'ESP_LOG_LEVEL' if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); ^~~~~~~~~~~~~ /home/tommy/esp_s3/esp-idf/components/log/include/esp_log.h:341:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL' #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~ ../components/softAP/soft_ap.c:44:9: note: in expansion of macro 'ESP_LOGI' ESP_LOGI(TAG, "station "MACSTR" join, AID=%d", ^~~~~~~~ /home/tommy/esp_s3/esp-idf/components/log/include/esp_log.h:264:27: error: format '%u' expects a matching 'unsigned int' argument [-Werror=format=] #define LOG_COLOR(COLOR) " 33[0;" COLOR "m" ^~~~~~~~~ cmakelists.txt内容为: Code: Select all http_server下: idf_component_register(SRCS "web_server.c" INCLUDE_DIRS "." EMBED_FILES "./html/web.html.gz" "./html/jquery.min.js.gz" PRIV_REQUIRES nvs_flash esp_http_server) Code: Select all softAP下: idf_component_register(SRCS "soft_ap.c" INCLUDE_DIRS "." PRIV_REQUIRES nvs_flash esp_http_server) 实在不太懂这个错误的来源,请有经验的大佬指点一下。 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
528浏览 6评论
438浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
425浏览 5评论
422浏览 4评论
396浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-5 23:22 , Processed in 0.787628 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号