Skip to content
Robert Lipe edited this page Nov 16, 2023 · 1 revision

for possibly automating configuration.

pio project config

Generates a flattened environment as generated by the inherited templating of platform.ini. Working on the env page, that can save a LOT of manually unrolling the tables. By happy coincidence, the first -D in build_flags is USUALLY the effect target used by that environment. (That's so close to a rule that we can make it so...)

Oho! We now have enough information to ask the preprocessor itself to give up the #defines based on that information. We grab the build_flags ot of that and then do things like:

➜ nightdriverstrip git:(fastled) ✗ gcc -DDEMO -dM -E include/globals.h 2>& /dev/null | grep "LED_PIN[0-9]"

#define LED_PIN0 5 ➜ nightdriverstrip git:(fastled) ✗ gcc -DATOMLIGHT -dM -E include/globals.h 2>& /dev/null | grep "LED_PIN[0-9]"

#define LED_PIN0 5 #define LED_PIN1 16 #define LED_PIN2 17 #define LED_PIN3 18

HA! We just got it to divulge which LED pins are defined for DEMO and ATOMLIGHT, respectively.

Now it's a mere matter of text processing to find out what targets use which effects and which targets enable WIFI and such.

It's not quite the solution I wanted, but it's not BAD...

Clone this wiki locally