You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not expected in general. What is the squiggle in the enum definition? I assume it can't find the values used to define the enum, so that appears to be causing the type to not get defined. Can you get those values to be defined?
Which of the include files listed in main.c includes nrf_gpiote.h? From your screenshot, I can't tell whether nrf_gpiote.h is actually included in the translation unit.
This should work, even with the squiggles in the enum value definitions.
You should set the "defines" property in your c_cpp_properties.json. Setting your compilerPath should set your compiler-based defines (excluding cl.exe).
Inability to navigate to the included files usually means your browse.path isn't set correctly (i.e. it should have ${workspaceFolder} and any other root folders where you need file navigation or workspace symbols).
José Xavier (@metropt), your latest screenshot shows that __APPLE__ is defined. The other (inactive) blocks are grayed out. If you are able to share your project, we can investigate further.
What I'm implying is that setting NRF51 won't do anything for this particular header file because you're already going through the __APPLE__ path, not the #else path. But maybe it matters elsewhere, so it might still be worth a try.
Bob Brown (@bobbrow) you're right, I looked at it as two conditions blocks -.-' There is a way to undefined the __APPLE__ variable for this project on vscode?
If you share the project, I can see if there's anything I can do for the time being. You can also try the forcedInclude property in c_cpp_properties.json to force include any of those nrf headers that end up missing.
I also saw an invalid path in your "includePath" array. You should remove that or switch to recursive includes "${workspaceFolder}/../nRF5_SDK_12.3.0_d7731ad/**". We improved the performance of recursive includes in 0.17.5-insiders, with further improvements coming in 0.17.5.
You can also remove the system include paths from "includePath" since you have specified the "compilerPath" property. My final c_cpp_properties.json looks like this:
Activity
sean-mcmanus commentedon Jun 4, 2018
UPDATE: Ignore what I wrote, see Bob's comment :)
It's not expected in general. What is the squiggle in the enum definition? I assume it can't find the values used to define the enum, so that appears to be causing the type to not get defined. Can you get those values to be defined?
bobbrow commentedon Jun 4, 2018
Which of the include files listed in
main.cincludesnrf_gpiote.h? From your screenshot, I can't tell whethernrf_gpiote.his actually included in the translation unit.This should work, even with the squiggles in the enum value definitions.
metropt commentedon Jun 9, 2018
Bob Brown (@bobbrow) main.c include nrf_drv_gpiote.h and it include nrf_gpiote.h
BTW on the main.c file I can't navigate to included files except the ones from the compiler path or the ones I have opened on the editor.
metropt commentedon Jun 9, 2018
How can I tell intellisense that a variable is defined?

I can share the project if it easier.
sean-mcmanus commentedon Jun 11, 2018
You should set the "defines" property in your c_cpp_properties.json. Setting your compilerPath should set your compiler-based defines (excluding cl.exe).
Inability to navigate to the included files usually means your browse.path isn't set correctly (i.e. it should have ${workspaceFolder} and any other root folders where you need file navigation or workspace symbols).
bobbrow commentedon Jun 11, 2018
José Xavier (@metropt), your latest screenshot shows that
__APPLE__is defined. The other (inactive) blocks are grayed out. If you are able to share your project, we can investigate further.metropt commentedon Jun 11, 2018
Bob Brown (@bobbrow) APPLE is a system variable but NRF51 isn't one. I'm going to try Sean McManus (@sean-mcmanus) advice tonight.
Should I use relative paths or it's fine to use absolute paths?
bobbrow commentedon Jun 11, 2018
What I'm implying is that setting
NRF51won't do anything for this particular header file because you're already going through the__APPLE__path, not the#elsepath. But maybe it matters elsewhere, so it might still be worth a try.metropt commentedon Jun 11, 2018
Bob Brown (@bobbrow) you're right, I looked at it as two conditions blocks -.-' There is a way to undefined the
__APPLE__variable for this project on vscode?bobbrow commentedon Jun 11, 2018
Unfortunately, not at this time. Cross-compilation support is on the backlog, but not currently available.
metropt commentedon Jun 11, 2018
bobbrow commentedon Jun 11, 2018
If you share the project, I can see if there's anything I can do for the time being. You can also try the
forcedIncludeproperty inc_cpp_properties.jsonto force include any of those nrf headers that end up missing.metropt commentedon Jun 11, 2018
https://www.dropbox.com/s/e9yhqq56vqr59yr/vscodecpp.zip?dl=0 the only thing I didn't include was arm gcc embedded.
Thank you
bobbrow commentedon Jun 12, 2018
Thanks. The
forcedIncludeproperty seems to do the trick for me.I also saw an invalid path in your
"includePath"array. You should remove that or switch to recursive includes"${workspaceFolder}/../nRF5_SDK_12.3.0_d7731ad/**". We improved the performance of recursive includes in 0.17.5-insiders, with further improvements coming in 0.17.5.You can also remove the system include paths from
"includePath"since you have specified the"compilerPath"property. My final c_cpp_properties.json looks like this:bobbrow commentedon Jun 12, 2018
And for reference, the cross-compiler support issue is #1083. Please go upvote that issue if you would like to bump up the priority.
metropt commentedon Jun 12, 2018
thank you for your help :) at least now I can navigate through the whole code!
sean-mcmanus commentedon Feb 3, 2021
José Xavier (@metropt)
__APPLE__can be undefined now with https://github.com/microsoft/vscode-cpptools/releases/tag/1.2.0 via changing the intelliSenseMode to something like "linux-gcc-x64", however, it may not solve your scenario, not sure -- we defineunixand__unix__on Linux, but not __unix. We're tracking some "unknown" platform with #6813 .