Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/02/10 15:24
Read: times


 
#177064 - Uart user menu via switch/case state machine
I'm implementing a user menu in my project to show logs, change settings, etc... Currently the user menu is a frequently called task from main in a round robin style multitasking environment. The menu itself is a state machine that either prints or looks for input and then exits.

This user menu function is getting quite large, and the general wisdom is to break up functions larger than (your favorite arbitrary line count here). Each state is a page or less with non-state related actions broken out into functions (user input and validations routines for instance), but the collection of states is growing quickly as more menu items are needed.

I have two questions.

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.

These questions are very implementation-specific I know, so I'm just looking for the best general discussion we can have on this while lacking details.

Thanks all!

--David

List of 29 messages in thread
TopicAuthorDate
Uart user menu via switch/case state machine            01/01/70 00:00      
   State machine can be small.            01/01/70 00:00      
   My take....            01/01/70 00:00      
   asked and answered            01/01/70 00:00      
      Broken and Fixed            01/01/70 00:00      
         excellent            01/01/70 00:00      
            My experience as well....            01/01/70 00:00      
               My experience as well....            01/01/70 00:00      
               But you're the writer...            01/01/70 00:00      
                  out of context            01/01/70 00:00      
                     Yes, Chances are no one else will see your code            01/01/70 00:00      
                        male cow manure            01/01/70 00:00      
                           Don't be too over confident            01/01/70 00:00      
                  Just Concepts            01/01/70 00:00      
                     Don't think own code is the best            01/01/70 00:00      
                     exactly            01/01/70 00:00      
                        what I have done a lot of lately is            01/01/70 00:00      
   Protothreads???            01/01/70 00:00      
   A case for a CASE tool?            01/01/70 00:00      
      Using a tool like that........            01/01/70 00:00      
         Thanks Michael...            01/01/70 00:00      
            Pencil and paper            01/01/70 00:00      
      Pros and Cons            01/01/70 00:00      
         Analysis/Design            01/01/70 00:00      
            Enterprise Architect            01/01/70 00:00      
               RE: Enterprise Architect            01/01/70 00:00      
                  Reverse State Tables            01/01/70 00:00      
                     RE: "Reverse-engineering"            01/01/70 00:00      
                        php and html when documenting            01/01/70 00:00      

Back to Subject List