Hierarchical State Machines in C
Check out the new state machine demo that runs in HEW on the H8 simulator using Simulated I/O. There's also a versino that runs on the M16C with the GNU compiler.
http://www.renesasrulz.com/downloads/m16c/R8C_HSM_sim.zip/view
StateMachines in C - Examples for UML StateChart implementations


This has been mentioned before
http://www.renesasrulz.com/forum/rtoses-and-other-software/33735794/#561272859