pico-sdk
pico-sdk copied to clipboard
Unable to use compiler defines to define pioasm values
I have created a library where the definitions of which pins to use are controlled by compiler defines in the CMakeLists.txt file.
For most of the pins used by my various PIO programs this works fine as they are set in the initialisation code and therefore the code has access to the defines as it forms part of the .pio.h file (or even in the main body of the code.)
However, one pin that I wait on is a gpio pin (wait 0 gpio
Suggestions on the forum include using the C preprocessor, which makes sense, but has issues as the pioasm syntax isn't particularly compatible. I've also looked at adding support for command line defines to pioasm, but that's also not clean as the complete list of compiler defines would probably also include non integer values which would need to be ignored.
So there doesn't seem to be a clean way to do this, at the moment I'm hardcoding that value into the pio files, but this make the library difficult to use by others.