I am looking at implementing a non-trivial finite state machine (specified as a UML hierarchical statechart) on a 32-bit MCU with gcc.
Are there any rules of thumb what works better and what works less well? My gut says that a switch-based (or even computed goto) implementation should be slightly more performant while a function-pointer based transition table is generally reputed to be more maintainable.
Also: has anybody evaluated Boost MSM for embedded applications? I know that Boost MSM is generally lauded as being very efficient, but for embedded applications efficiency might be measured differently than in the world of PC programming.
Does anybody know what the compiled state machine engine of MSM looks like? More like a switch jumptable or more like a function pointer transition table? Does it use dynamic memory allocation or can it used statically?