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_AGCPage.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 extern volatile bool exittorecord; 00010 00011 00012 int AGCPageHandler() 00013 { 00014 int userSelection = 0; 00015 pageMenu[AGC].printMenu(); 00016 00017 unsigned char lastState = 0x0f; //0000 1111 00018 bool exitCurrentMenu = false; 00019 00020 while ( exitCurrentMenu == false) 00021 { 00022 00023 unsigned char currentState = switches.read(); //reading a port add a AND MASK & 0b00000111 00024 wait_ms(10); 00025 if( currentState == switches.read() && currentState != lastState) 00026 { 00027 lastState = currentState; 00028 switch(currentState) 00029 { 00030 case 0x0e: 00031 pageMenu[AGC].erase(); 00032 printXY(" ", 5, 10); 00033 userSelection = RECORDSET; 00034 exitCurrentMenu = true; 00035 break; 00036 case 0x0d: 00037 pageMenu[AGC].highlightPrevItem(); 00038 break; 00039 case 0x0b: 00040 pageMenu[AGC].highlightNextItem(); 00041 break; 00042 case 0x07: 00043 userSelection = pageMenu[AGC].getHighlightedItem() ; 00044 pageMenu[AGC].removeselection(); 00045 pageMenu[AGC].selection(); 00046 break; 00047 }//eo select 00048 /* 00049 if (userSelection != 0 && userSelection != RECORDSET) 00050 { 00051 // place code here to handle actions processed directly from this page 00052 switch(userSelection) 00053 { 00054 case AGCON: 00055 printXY(" ", 5,2); 00056 printXY("<", 4, 1); 00057 //call function to perform task 00058 break; 00059 case AGCOFF: 00060 printXY(" ", 4, 1); 00061 printXY("<",5, 2); 00062 //call function to perform task 00063 break; 00064 } 00065 // eo place code here ...... 00066 userSelection = 0; 00067 } 00068 */ 00069 wait_ms(200); 00070 if (exittorecord == true) 00071 break; 00072 00073 00074 }//eo if kbhit 00075 }//eo while 00076 return userSelection; 00077 }
Generated on Sat Jul 23 2022 00:51:58 by
1.7.2
