Open TheUnityGuru opened 3 years ago
I have the same issue, Windows 10 , Arduino nano RP2040 connect , is there any walkaround ?
Same issue here. Windows 10 Pro 21H1 (19043.1165).
Version: 2.0.0-beta.10 Date: 2021-08-05T08:23:32.577Z CLI Version: 0.18.3 alpha [d710b642]
It seems that whenever a line such as:
extern Serial_ Serial;
is used in Arduino's code (USBAPI.h
in this case), all methods inside Serial_
are not detected as belonging to the Serial
class actually used in the users' sketches. I experience the same issue with the Keyboard.h
external library. See:
Here's how I experience this with Neovim:
If someone ends up here, a simple workaround is to define the USBCON
macro, either at the beginning of main.h
, or in your
clangd config .clangd
like this:
CompileFlags:
Add: [
-DARDUINO=186, # To prevent libs from using WProgram. (not needed here)
-DUSBCON=, # To prevent the Serial not being defined
]
Make sure this does not overwrite the normal macro value during the compilation process.
Describe the bug The class "Serial" is not recognized and is considered a "Undeclared Identifier"
To Reproduce Just try this to initialize the hardware serial in the void setup.
Expected behavior Well, nothing is supposed to happen. The IDE is supposed to recognize it
Screenshots
Desktop (please complete the following information):
Additional context Just downloaded it, installed the arduino AVR boards, and tried out this simple sketch. NOTHING ELSE HAS BEEN DONE