Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ANSITermMenuSystem
Fork of menuSystemMbed by
HANDLER_HomePage.cpp
00001 #include "mbed.h" 00002 00003 #include "menuIDs.h" 00004 #include "MainMenu.h" 00005 00006 00007 extern BusInOut switches; //(p21, p22, p23, p24) 00008 extern MainMenu pageMenu[MAXPAGES]; 00009 extern volatile bool exittorecord; 00010 00011 int homePageHandler() 00012 { 00013 int userSelection = 0; 00014 pageMenu[HOME].printMenu(); 00015 00016 unsigned char lastState = 0x0f; //0000 1111 00017 bool exitCurrentMenu = false; 00018 00019 while ( exitCurrentMenu == false) 00020 { 00021 00022 unsigned char currentState = switches.read(); //reading a port add a AND MASK & 0b00000111 00023 wait_ms(10); 00024 if( currentState == switches.read() && currentState != lastState) 00025 { 00026 lastState = currentState; 00027 switch(currentState) 00028 { 00029 case 0x0e: 00030 pageMenu[HOME].erase(); 00031 userSelection = HOME; 00032 exitCurrentMenu = true; 00033 break; 00034 case 0x0d: 00035 pageMenu[HOME].highlightPrevItem(); 00036 break; 00037 case 0x0b: 00038 pageMenu[HOME].highlightNextItem(); 00039 break; 00040 case 0x07: 00041 pageMenu[HOME].erase(); 00042 userSelection = pageMenu[HOME].getHighlightedItem(); 00043 exitCurrentMenu = true; 00044 break; 00045 }//eo select 00046 wait_ms(200); 00047 if (exittorecord == true) 00048 break; 00049 00050 }//eo if switch press detected 00051 }//eo while 00052 return userSelection; 00053 }
Generated on Sat Jul 23 2022 00:51:58 by
1.7.2
