return to main menu added

This commit is contained in:
richonguzman 2023-06-24 17:47:07 -04:00
parent befef083a4
commit d004a2544e
4 changed files with 22 additions and 5 deletions

View File

@ -1,8 +1,8 @@
{
"beacons": [
{
"callsign": "CD2RXU-8",
"symbol": "j",
"callsign": "CD2RXU-7",
"symbol": "[",
"comment": "",
"smart_beacon": {
"active": true,
@ -17,7 +17,7 @@
}
},
{
"callsign": "CD2RXU-8",
"callsign": "CD2RXU-7",
"symbol": "b",
"comment": "",
"smart_beacon": {
@ -33,7 +33,7 @@
}
},
{
"callsign": "CD2RXU-8",
"callsign": "CD2RXU-7",
"symbol": ">",
"comment": "",
"smart_beacon": {

View File

@ -55,6 +55,8 @@ double lastTxDistance = 0.0;
double currentHeading = 0;
double previousHeading = 0;
uint32_t menuTime = millis();
logging::Logger logger;

View File

@ -15,6 +15,7 @@ extern bool statusState;
extern bool displayEcoMode;
extern int myBeaconsSize;
extern Configuration Config;
extern uint32_t menuTime;
namespace BUTTON_Utils {
@ -32,8 +33,10 @@ void singlePress() {
MSG_Utils::loadMessagesFromMemory();
if (MSG_Utils::warnNoMessages()) {
menuDisplay = 1;
menuTime = millis();
} else {
menuDisplay = 10;
menuTime = millis();
}
} else if (menuDisplay == 2) {
logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "Loop", "%s", "wrl");
@ -42,12 +45,15 @@ void singlePress() {
messagesIterator++;
if (messagesIterator == MSG_Utils::getNumAPRSMessages()) {
menuDisplay = 1;
menuTime = millis();
messagesIterator = 0;
} else {
menuDisplay = 10;
menuTime = millis();
}
} else if (menuDisplay == 20) {
menuDisplay = 2;
menuTime = millis();
} else if (menuDisplay == 3) {
show_display("__INFO____", "", "Nothing Yet...", 1500);
}
@ -70,6 +76,7 @@ void longPress() {
MSG_Utils::loadNumMessages();
} else if (menuDisplay == 2) {
menuDisplay = 20;
menuTime = millis();
} else if (menuDisplay == 3) {
if (!displayEcoMode) {
displayEcoMode = true;
@ -85,13 +92,17 @@ void doublePress() {
display_toggle(true);
if (menuDisplay == 0) {
menuDisplay = 1;
menuTime = millis();
} else if (menuDisplay == 1) {
menuDisplay = 2;
menuTime = millis();
messagesIterator = 0;
} else if (menuDisplay == 2) {
menuDisplay = 3;
menuTime = millis();
} else if (menuDisplay == 3 || menuDisplay == 20) {
menuDisplay = 0;
menuTime = millis();
displayTime = millis();
}
}

View File

@ -15,11 +15,15 @@ extern TinyGPSPlus gps;
extern PowerManagement powerManagement;
extern std::vector<String> loadedAPRSMessages;
extern int messagesIterator;
extern uint32_t menuTime;
namespace MENU_Utils {
void showOnScreen() {
uint32_t lastMenuTime = millis() - menuTime;
if (!(menuDisplay==0) && !(menuDisplay==20) && lastMenuTime > 30*1000) {
menuDisplay = 0;
}
switch (menuDisplay) { // Graphic Menu is in here!!!!
case 1:
show_display("__MENU_1__", "", "1P -> Read Msg (" + String(MSG_Utils::getNumAPRSMessages()) + ")", "LP -> Delete Msg", "2P -> Menu 2");