I am re-factoring a bunch of Adafruit Arduino libraries for the Raspberry Pico SDK “baremetal” platform, with the intention of submitting PRs once completed.
My goal is to submit a PR with minimal changes, so no re-writing their base classes or other extensive refactoring with funky static templates that place a heavy burden on the maintainers.
-
The libraries only have a “
library.properties
” for each, which how I assume PIO decides it’s an Arduino only library? I ask because I need to uselib_compat_mode = off
to test compile them. Is alibrary.json
the way to go without breaking existing Arduino compatibility? -
Most of the
.h
files are fine and can be fixed with a few#ifdef #define
, but they do need new.cpp
implementations. Assuming no clever CRTP et al, I basically want “build time polymophism” for want of a better expression. I need to be able to change thesrcFilter
in thelibrary.json
based on the platform so I can select the implementation files via a simple+<pico.cpp> -<arduino.cpp>
.
Are there any docs or existing libraries I can look at that will help me here?
Cheers,
~N