Replies: 2 comments 5 replies
-
That's the Arduino IDE doing it's thing. It doesn't understand Moral of the story is to use comments not if blocks to remove includes in the main INO. For other .c files, I don't believe the IDE scans then so you can use if blocks there, if you really want. |
Beta Was this translation helpful? Give feedback.
-
And of course, now that I know what's going on, I can see PlatformIO has settings to change this behaviour ( https://docs.platformio.org/en/latest/librarymanager/ldf.html#ldf-mode The default is |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So, I encountered this mind boggling problem with my complex IoT project, but just to make sure I'm not going crazy, I created a minimal sample using (https://github.com/maxgerhardt/platform-raspberrypi#5a533d6b36844183bb72794bc53091206165e921 ), and I'm getting the same problem:
Sharing this here since I'm really running out of ideas on how the heck this is possible.
I have over 20 years experience with C++ (I'm a software engineer) and never seen a problem like this.
Very-very likely not related to Arduino-Pico, but I'm out of ideas, and maybe someone has seen something similar.
Scenario:
Given this simple program:
It compiles to this:
and it works fine.
Now changing JUST the
#if 0
to this:It compiles to this:
And the firmware doesn't work.
#if 0
affecting my build (the firmware size clearly shows that). Note that there is no other code. I understand that MAYBE this could be pranked by doing a#define 0 1
or something like that, but that this is a minimal sample I created just now.And it still builds, clearly showing that
#error
is not seen.Anyone has encountered this before? haha
Beta Was this translation helpful? Give feedback.
All reactions