-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Would it be possible to replace the static inline
s with a configurable attribute that can be disabled if necessary?
Background
We are using a Rust library to implement the main logic. The lib defines a pub extern "C" fn rust_entry()
which gets called from the C main
function and then takes over control and calls back into the Pico-SDK where necessary (e.g. for malloc
/free
, GPIO etc.)
This concept works amazingly well – except for one problem: Since a lot of the SDK's functions are static
, we cannot link against them. Our current workaround is to implement a 1:1 C-wrapper for all the static
functions we need – however this gets quite cumbersome over time.
A possible naive solution could be sth. like
#ifndef PICO_DISABLE_STATIC_INLINE
#define __pico_static_inline static inline
#else
#define __pico_static_inline
#endif
and then using __pico_static_inline
on all functions (if it is not crucial that they are inlined of course).
I know that our setup is probably a little bit exotic and I'm completely fine if this issue gets closed 😅
However IMO this could ease the burden to write an application in language-of-your-choice, because if you can link back against the SDK, you suddenly don't need an entire native toolchain/SDK in language-of-your-choice anymore to get stuff running.