microsoft / vscode-arduino

Visual Studio Code extension for Arduino

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] c_cpp_properties file build lack of the specific board defines

LiWeny16 opened this issue · comments

INFO

  • borad: Mega2560
  • platform: Windows10
  • vscode-arduino version: v0.6.230727001

Register way In IntelliSense Error

If we use the register way like ”INTF4、_BV“ to program arduino, in vscode will have some problem in Intellisense(not in compile session):
image

The vscode-arduino plugin should do this job for us:
To add specific borad type to tell the intellisense to include the right libs.
Otherwise while using Mega2560, the lib of "<avr/iom16u2.h>" will not be included by Intellisense correctly.

// <avr/io.h>
#elif defined (__AVR_ATmega16U2__)
#  include <avr/iom16u2.h>

How to fix this problem?

While generating the c_cpp_properties.json file, vscode-arduino should add this info to tell Intellisense to include the correct lib:

image