better cobboard commands in strat_event
[aversive.git] / projects / microb2010 / ballboard / state.c
index 57d44ff..f9a5f8a 100644 (file)
@@ -144,13 +144,20 @@ static void state_do_eject(void)
 /* main state machine */
 void state_machine(void)
 {
+       uint8_t mode = 0;
+
        while (state_want_exit() == 0) {
 
+               if (state_mode != mode) {
+                       mode = state_mode;
+                       STMCH_DEBUG("%s(): mode=%x ", __FUNCTION__, mode);
+               }
+
                switch (state_mode) {
 
                case INIT:
-                       state_mode = OFF;
                        state_init();
+                       state_mode = OFF;
                        break;
 
                case OFF: