diff --git a/esp8266_deauther/DisplayUI.cpp b/esp8266_deauther/DisplayUI.cpp index 32de03d..abcbafc 100644 --- a/esp8266_deauther/DisplayUI.cpp +++ b/esp8266_deauther/DisplayUI.cpp @@ -87,15 +87,10 @@ void DisplayUI::setup() { scan.start(SCAN_MODE_SNIFFER, 0, SCAN_MODE_OFF, 0, false, wifi_channel); mode = DISPLAY_MODE::PACKETMONITOR; }); - - addMenuNode(&mainMenu, D_CLOCK, [this]() { // CLOCK - mode = DISPLAY_MODE::CLOCK; - display.setFont(ArialMT_Plain_24); - display.setTextAlignment(TEXT_ALIGN_CENTER); - }); + addMenuNode(&mainMenu, D_CLOCK, &clockMenu); // CLOCK #ifdef HIGHLIGHT_LED - addMenuNode(&mainMenu, D_LED, [this]() { // LED + addMenuNode(&mainMenu, D_LED, [this]() { // LED highlightLED = !highlightLED; digitalWrite(HIGHLIGHT_LED, highlightLED); }); @@ -446,6 +441,20 @@ void DisplayUI::setup() { }); }); + // CLOCK MENU + createMenu(&clockMenu, &mainMenu, [this]() { + addMenuNode(&clockMenu, D_CLOCK_DISPLAY, [this]() { // CLOCK + mode = DISPLAY_MODE::CLOCK_DISPLAY; + display.setFont(ArialMT_Plain_24); + display.setTextAlignment(TEXT_ALIGN_CENTER); + }); + addMenuNode(&clockMenu, D_CLOCK_SET, [this]() { // CLOCK SET TIME + mode = DISPLAY_MODE::CLOCK; + display.setFont(ArialMT_Plain_24); + display.setTextAlignment(TEXT_ALIGN_CENTER); + }); + }); + // ===================== // // set current menu to main menu @@ -601,6 +610,7 @@ void DisplayUI::setupButtons() { break; case DISPLAY_MODE::CLOCK: + case DISPLAY_MODE::CLOCK_DISPLAY: mode = DISPLAY_MODE::MENU; display.setFont(DejaVu_Sans_Mono_12); display.setTextAlignment(TEXT_ALIGN_LEFT); @@ -700,6 +710,7 @@ void DisplayUI::draw(bool force) { drawIntro(); break; case DISPLAY_MODE::CLOCK: + case DISPLAY_MODE::CLOCK_DISPLAY: drawClock(); break; case DISPLAY_MODE::RESETTING: diff --git a/esp8266_deauther/DisplayUI.h b/esp8266_deauther/DisplayUI.h index bb8a7ab..67eee6d 100644 --- a/esp8266_deauther/DisplayUI.h +++ b/esp8266_deauther/DisplayUI.h @@ -77,6 +77,7 @@ enum class DISPLAY_MODE { OFF, PACKETMONITOR, INTRO, CLOCK, + CLOCK_DISPLAY, RESETTING }; class DisplayUI { @@ -156,6 +157,7 @@ class DisplayUI { Menu scanMenu; Menu showMenu; Menu attackMenu; + Menu clockMenu; Menu apListMenu; Menu stationListMenu; diff --git a/esp8266_deauther/language.h b/esp8266_deauther/language.h index b6c1ab3..1325d81 100644 --- a/esp8266_deauther/language.h +++ b/esp8266_deauther/language.h @@ -365,6 +365,8 @@ const char D_SHOW[] PROGMEM = "SELECT"; const char D_ATTACK[] PROGMEM = "ATTACK"; const char D_PACKET_MONITOR[] PROGMEM = "PACKET MONITOR"; const char D_CLOCK[] PROGMEM = "CLOCK"; +const char D_CLOCK_DISPLAY[] PROGMEM = "CLOCK DISPLAY"; +const char D_CLOCK_SET[] PROGMEM = "SET CLOCK"; // SCAN MENU const char D_SCAN_APST[] PROGMEM = "SCAN AP + ST";