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.
Fork of menuSystemMbed by
HANDLER_RecordSettings.cpp
00001 #include "mbed.h" 00002 00003 #include "menuIDs.h" 00004 #include "MainMenu.h" 00005 #include "console.h" 00006 00007 extern BusInOut switches; //(p21, p22, p23, p24) 00008 extern MainMenu pageMenu[MAXPAGES ]; 00009 00010 int RecordSettingsHandler() 00011 { 00012 int userSelection = 0; 00013 pageMenu[RECORDSET].printMenu(); 00014 00015 unsigned char lastState = 0x0f; //0000 1111 00016 bool exitCurrentMenu = false; 00017 00018 while ( exitCurrentMenu == false) 00019 { 00020 00021 unsigned char currentState = switches.read(); //reading a port add a AND MASK & 0b00000111 00022 wait_ms(10); 00023 if( currentState == switches.read() && currentState != lastState) 00024 { 00025 lastState = currentState; 00026 switch(currentState) 00027 { 00028 case 0x0e: 00029 pageMenu[RECORDSET].erase(); 00030 userSelection = HOME; 00031 exitCurrentMenu = true; 00032 break; 00033 case 0x0d: 00034 pageMenu[RECORDSET].highlightPrevItem(); 00035 break; 00036 case 0x0b: 00037 pageMenu[RECORDSET].highlightNextItem(); 00038 break; 00039 case 0x07: 00040 pageMenu[RECORDSET].erase(); 00041 userSelection = pageMenu[RECORDSET].getHighlightedItem() - RECSETOFFSET; 00042 exitCurrentMenu = true; 00043 break; 00044 }//eo select 00045 wait_ms(200); 00046 }//eo if kbhit 00047 }//eo while 00048 return userSelection; 00049 }
Generated on Tue Jul 12 2022 23:00:53 by
1.7.2
