??? 07/02/10 15:57 Read: times |
#177069 - asked and answered Responding to: ???'s previous message |
1> Is there any value in breaking up a state machine even though it spans multiple pages? It might be a little more "presentable" but adds more overhead in additional state variables and return value checks.
2> Is a state machine the a good way to code multi-level user menus? It was my first inclination, and does work, but if there is a more industry standard way to do such things, I'd like to know. you answer "Is there any value in breaking up a state machine" yourself. Make every level a separate function. you can also; while having the state storage local make the state names global and make subfunctions like this U8 next_state subfunc (U8 current_state) and call state subfunc(state); Erik |