I use visual studio code with the current espressif plugin (IDF version 5.1.2). The following program can be compiled and executed on the esp32 without any problems:
#include <iostream>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "main.h"
void HelloCMake::run(int i)
{
std::cout << "Hello World from C++ "<< i << 'n';
vTaskDelay(pdMS_TO_TICKS(1000));
}
extern "C" void app_main(void)
{
HelloCMake App;
int i = 0;
while (true)
{
App.run(i);
i++;
}
}
However, the editor shows me the following:
- identifier "vTaskDelay" is undefined
- identifier "pdMS_TO_TICKS" is undefined
Why are the two problems still displayed? And how can I solve this, please?
Thanks!
Markus
Translated with DeepL.com (free version)
Asked Google and ChatGPT…
2
Answers
Thank you 👌
I found this article and activate the recursive search configuration. Now i have a working syntax highlightning.
you need to add esp include path to JSON file for syntax recognition in VScode editor. Compile and IDE syntax highlight is 2 different things, IDE environment emphasis error because it does not able to find the declaration of the function, nothing to do with compile.