I've tried this and would be grateful for any pointers (excuse pun) where I'm going wrong. This is what I've tried but doesn't work. FYI this is for the DS80C400. Thanks in advance.
*************************************** typedef enum { FUN1, FUN2, FUN3} state_type;state_type current_state;
void (*state_table [] ) () = { fun1, fun2, fun3};
void fun1 (void) { printf("\nFun1"); current_state = FUN2; }
void fun2 (void) { printf("\nFun2"); current_state = FUN3; }
void fun3 (void) { printf("\nFun3"); current_state = FUN1; }
void main (void) { current_state = FUN1; while(1) { state_table[current_state](); } }