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_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 00010 00011 int AGCPageHandler() 00012 { 00013 int userSelection = 0; 00014 pageMenu[AGC].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[AGC].erase(); 00031 printXY(" ", 5, 10); 00032 userSelection = RECORDSET; 00033 exitCurrentMenu = true; 00034 break; 00035 case 0x0d: 00036 pageMenu[AGC].highlightPrevItem(); 00037 break; 00038 case 0x0b: 00039 pageMenu[AGC].highlightNextItem(); 00040 break; 00041 case 0x07: 00042 userSelection = pageMenu[AGC].getHighlightedItem() ; 00043 break; 00044 }//eo select 00045 00046 if (userSelection != 0 && userSelection != RECORDSET) 00047 { 00048 // place code here to handle actions processed directly from this page 00049 switch(userSelection) 00050 { 00051 case AGCON: 00052 printXY("AGC is On ", 5, 10); 00053 //call function to perform task 00054 break; 00055 case AGCOFF: 00056 printXY("AGC is Off ",5,10); 00057 //call function to perform task 00058 break; 00059 } 00060 // eo place code here ...... 00061 userSelection = 0; 00062 } 00063 wait_ms(200); 00064 }//eo if kbhit 00065 }//eo while 00066 return userSelection; 00067 }
Generated on Tue Jul 12 2022 23:00:53 by
1.7.2
