The following is the complete source code, which compiles successfully but triggers errors in clangd.
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#define OUT_GPIO GPIO_NUM_15
#define OUT_MASK (1ULL<<OUT_GPIO)
void app_main(void)
{
gpio_config_t io_conf={OUT_MASK,GPIO_MODE_OUTPUT,GPIO_PULLUP_DISABLE,GPIO_PULLDOWN_DISABLE,GPIO_INTR_DISABLE};
gpio_config(&io_conf);
while(true)
{
gpio_set_level(OUT_GPIO, 1);
vTaskDelay(1000/portTICK_PERIOD_MS);
printf("输出一\n");
gpio_set_level(OUT_GPIO, 0);
vTaskDelay(1000/portTICK_PERIOD_MS);
printf("输出零\n");
}
}
Help needed: clangd in VSCode with ESP-IDF reports printf function not found error
-
1403847775@qq.com
- Posts: 4
- Joined: Wed Nov 22, 2023 1:15 am
Help needed: clangd in VSCode with ESP-IDF reports printf function not found error
- Attachments
-
- 无标题.png (76.69 KiB) Viewed 407 times
-
- printf.jpg (158.03 KiB) Viewed 407 times
-
MicroController
- Posts: 2669
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Help needed: clangd in VSCode with ESP-IDF reports printf function not found error
Try adding #include <stdio.h>.
-
1403847775@qq.com
- Posts: 4
- Joined: Wed Nov 22, 2023 1:15 am
Re: Help needed: clangd in VSCode with ESP-IDF reports printf function not found error
I've already attempted this, yet clangd persists in reporting 'printf function not found'.Try adding #include <stdio.h>.
- Attachments
-
- include.png (79.83 KiB) Viewed 382 times
Who is online
Users browsing this forum: Applebot, Qwantbot, Semrush [Bot] and 3 guests