QP (http://www.quantum-leaps.com/downloads/) is a family of ultra-light, open source, state machine-based frameworks for embedded systems. QP enables developing well-structured applications as a set of concurrently executing hierarchical state machines (UML statecharts). With QP, coding of modern state machines directly in C or C++ is a non-issue and no big design automation tools are needed.
QP consists of a universal UML-compliant event processor (QEP), a portable event-driven framework (QF), and a selection of a cooperative or full preemptive kernels (QK). Current versions of QP include: QP/C and QP/C++, which require about 4KB of code and a few hundred bytes of RAM, and the ultra-lightweight QP-nano, which requires only 1-2KB of code and just several bytes of RAM. QP is described in great detail in the book Practical UML Statecharts in C/C++, Second Edition, (http://www.amazon.com/exec/obidos/ASIN/0750687061/quantumleap06-20).
QP can work on "bare metal" processor, effectively replacing a traditional RTOS. In fact, QP allows you to choose either a cooperative or fully preemptive kernel (QK). QP/C and QP/C++ can also work with traditional RTOS/OS, such as uC/OS-II or FreeRTOS.org to take advantage of existing communication stacks (e.g., TCP/IP), or other legacy code.
The QP Development Kits (QDKs) for AVR have been recently released and are available for immediate download from http://www.quantum-leaps.com/avr.