Quantum Leaps has released his QP state machine framework for Arduino. He says:
QP is a lightweight, open source, state machine framework for microcontrollers such as Arduino. QP enables you to build well-structured and power-efficient event-driven programs as systems of concurrently executing state machines (UML statecharts). You can think of QP as a modern real-time operating system (RTOS) specifically designed for executing state machines. The QP framework does everything you can expect from a traditional RTOS, only more efficiently, plus many things an RTOS can’t do at all.
Essentially QP focuses on an event driven programming model as opposed to the sequential model of conventional Arduino programs. The libraries and examples are open source. A QM Modeling and code generation tool is also available as a free download, but is not open source.
A zip file download contains source code libraries, examples and documentation.