Menu system broken
Dependencies: ANSITermMenuSystem
Fork of menuSystemMbed by
HANDLER_SamplingPage.cpp
- Committer:
- Rybowonder
- Date:
- 2013-04-16
- Revision:
- 4:1178a1905490
- Parent:
- 3:bdf42b6c15f4
- Child:
- 7:df9f5b6dd4ed
File content as of revision 4:1178a1905490:
#include "mbed.h" #include "menuIDs.h" #include "MainMenu.h" #include "console.h" extern BusInOut switches; //(p21, p22, p23, p24) extern MainMenu pageMenu[MAXPAGES ]; int SamplesPageHandler() { int userSelection = 0; pageMenu[SAMPRATE].printMenu(); unsigned char lastState = 0x0f; //0000 1111 bool exitCurrentMenu = false; while ( exitCurrentMenu == false) { unsigned char currentState = switches.read(); //reading a port add a AND MASK & 0b00000111 wait_ms(10); if( currentState == switches.read() && currentState != lastState) { lastState = currentState; switch(currentState) { case 0x0e: pageMenu[SAMPRATE].erase(); printXY(" ", 5, 10); userSelection = RECORDSET; exitCurrentMenu = true; break; case 0x0d: pageMenu[SAMPRATE].highlightPrevItem(); break; case 0x0b: pageMenu[SAMPRATE].highlightNextItem(); break; case 0x07: userSelection = pageMenu[SAMPRATE].getHighlightedItem() ; pageMenu[SAMPRATE].removeselection(); pageMenu[SAMPRATE].selection(); break; }//eo select /* if (userSelection != 0 && userSelection != RECORDSET) { // place code here to handle actions processed directly from this page switch(userSelection) { case SPEED1: printXY("44.1k Selected ", 5, 10); //call function to perform task break; case SPEED2: printXY("48k selected ",5,10); //call function to perform task break; } // eo place code here ...... userSelection = 0; } */ wait_ms(200); }//eo if kbhit }//eo while return userSelection; }