1

When developing for micro controller, we use a lot of compile-time defines passed to the compiler with the "-Dxxxx" syntax. I would like to configure vscode such that it knows that certain defines will be provided and such that it highlights code properly corresponding to those info.

How would I do that ?

Manuel Yguel
  • 198
  • 1
  • 9
  • Could be a better way today, but here is an older question: https://stackoverflow.com/questions/46415076/how-can-i-define-macros-for-the-c-intellisense-engine – Eugene Sh. Mar 25 '22 at 16:24

1 Answers1

3

I am assuming you have C/C++ extension installed.

1 - Open Command Palette by Ctrl + Shift + P or View -> Command Palette...
2 - Select C/C++: Edit Configurations (UI)
3 - Scroll down to Defines section, where you can add your defines/macros.

Also, In this tab you can tell vscode about your compiler options such as, the compiler arguments, the language standard you are using, include paths, etc.

whh
  • 33
  • 1
  • 5