]> git.droids-corp.org - aversive.git/blobdiff - projects/microb2010/ballboard/state.c
better cobboard commands in strat_event
[aversive.git] / projects / microb2010 / ballboard / state.c
index 57d44ff6a0e924a0099ffb29e9463f0bc1b48c63..f9a5f8a7f9fa9c9a9df8cf41886cb0cc2f07e477 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: