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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/26/10 18:52
Read: times


 
#178331 - Broken and Fixed
Responding to: ???'s previous message
Just to follow up on this thread, I went ahead and broke each sub-menu off into it's own function. In order to save ram, I have one global shared state variable that is common to all submenus, since by definition, only one submenu will ever be active at a time. All submenus return a submenu "code" with code 0 being a logical "Back" or "Up" command.

The menu logic was arranged in a separate function which calls the submenu functions and takes care of the "Back" state.

The end result is much cleaner looking code in which all related menu items are grouped together in small chunks and the overall menu structure can be reorganized in the menu logic function without touching the submenus.

Thanks for the push, everyone!

--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