This implementation requires n + 2 stack frames, where n is the depth of the hierarchical state machine.
- Constant stack usage: superstate event handling (
default:
switch case) can be postponed after the stack-frame exits, within thehfsm_post_event()
function by using return codes. The deep CPU stack can be converted into afor
loop.