Anyone ported the QP state framework for Arduino?
I would avoid this kind of thing like the plague.

Most "serious" low level software I've encountered has been a state machine in this form:

#include &lt;stdio.h&gt;

typedef enum
{
    STATE_INIT,     // Description
    STATE_RUNNING,  // Description
    STATE_COMPLETE  // Description
} state_t;

int main(void)
{
    state_t state = STATE_INIT; // setup the initial state

    while(1)
    {
        os_run(); // call the OS services (poll the UART, check buttons, etc.)

        switch(state)
        {
            case STATE_INIT:
                state = STATE_RUNNING;
                puts("init");
                break;
            case STATE_RUNNING:
                state = STATE_COMPLETE;
                puts("running");
                break;
            case STATE_COMPLETE:
                puts("complete");
                break;
        }
    }
    return 0;
}


There are plenty of other good approaches in C/C++, but they're not my favourite.

The big problem with tools like QP is that it's often very hard to do things they don't want you to. If you do choose to fiddle with code manually you'll have to maintain the special case forever.

I'd say, UML statecharts are a fantastic tool for documentation, teaching and analysis. But, not for actual programming - there are much better tools for that :)