that is a very fair point; my reference to inlining was unnecessary and a red herring. sorry!
but since weāre here, we may as well dig down on inline a bit, since there is a ton of confusion about it. i have partaken in this confusion: i first was told to use inline liberally in the 90s, as an alternative to macros, because inlining was āfasterā - this not really true anymore but it is a pervasive misconception.
here are the relevant references
http://en.cppreference.com/w/c/language/inline
https://gcc.gnu.org/onlinedocs/gcc/Inline.html
in a nutshell:
-
inline was first introduced in c++, where you often see extern inline in header files. this tells the compiler that the function may be defined in multiple compilation units (and those definitions must in fact be the same.) it is basically static for header files, and is a bit of a misnomer because it is really about linker visibility and not inlining per se.
-
in C, you most often see inline func() {} in headers and extern inline func; in .c files.
-
there are other subtle differences. in C, funtion-local statics from different definitions of an inline function are distinct; in C++ they are the same!
-
in C you also often see static inline func() {} in .c files and this is probably the usage weāre both thinking of.
the gcc docs make things a little more specific (thankfully)
When a function is both inline and static, if all calls to the function are integrated into the caller, and the functionās address is never used, then the functionās own assembler code is never referenced. In this case, GCC does not actually output assembler code for the function, unless you specify the option -fkeep-inline-functions.
most of the uses of inline in my code (relevantly, aleph and libavr32) are in this context. they are always very short functions, usually wrapping a single function call for the purposes of readability. i would argue that this usage does not actually increase the code size - no ASM is emitted for the function, and each call to it in the code is simply replaced with a different, less readable function call.
that said, itās not really a useful optimization either way since the compiler will decide on its own what to inline (thank you very much) and in addition will consider optimization flags at compile time.
so on balance i think its very rare that using inline is actually a good idea, except in specific and unusual idioms (like case 2 above). IIRC it is actually necessary in c++ for certain template specializations⦠but thatās āOTā 
TL/DR: youāre right - kids, donāt use inline unless you really need it, and you probably donāt.
BTW, i should say that i in no way intended to nitpick your code, but just wanted to weigh in (alongside others) on the benefit / drawbacks of function pointers in embedded contexts. not because you havenāt considered it, but because this thread is ātips and tricksā and has a pedagogical / dialogue function.