Skip to content

Commit 4e7264b

Browse files
author
Spacehuhn
committed
Clock submenu
1 parent 0272e83 commit 4e7264b

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

esp8266_deauther/DisplayUI.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,10 @@ void DisplayUI::setup() {
8787
scan.start(SCAN_MODE_SNIFFER, 0, SCAN_MODE_OFF, 0, false, wifi_channel);
8888
mode = DISPLAY_MODE::PACKETMONITOR;
8989
});
90-
91-
addMenuNode(&mainMenu, D_CLOCK, [this]() { // CLOCK
92-
mode = DISPLAY_MODE::CLOCK;
93-
display.setFont(ArialMT_Plain_24);
94-
display.setTextAlignment(TEXT_ALIGN_CENTER);
95-
});
90+
addMenuNode(&mainMenu, D_CLOCK, &clockMenu); // CLOCK
9691

9792
#ifdef HIGHLIGHT_LED
98-
addMenuNode(&mainMenu, D_LED, [this]() { // LED
93+
addMenuNode(&mainMenu, D_LED, [this]() { // LED
9994
highlightLED = !highlightLED;
10095
digitalWrite(HIGHLIGHT_LED, highlightLED);
10196
});
@@ -446,6 +441,20 @@ void DisplayUI::setup() {
446441
});
447442
});
448443

444+
// CLOCK MENU
445+
createMenu(&clockMenu, &mainMenu, [this]() {
446+
addMenuNode(&clockMenu, D_CLOCK_DISPLAY, [this]() { // CLOCK
447+
mode = DISPLAY_MODE::CLOCK_DISPLAY;
448+
display.setFont(ArialMT_Plain_24);
449+
display.setTextAlignment(TEXT_ALIGN_CENTER);
450+
});
451+
addMenuNode(&clockMenu, D_CLOCK_SET, [this]() { // CLOCK SET TIME
452+
mode = DISPLAY_MODE::CLOCK;
453+
display.setFont(ArialMT_Plain_24);
454+
display.setTextAlignment(TEXT_ALIGN_CENTER);
455+
});
456+
});
457+
449458
// ===================== //
450459

451460
// set current menu to main menu
@@ -601,6 +610,7 @@ void DisplayUI::setupButtons() {
601610
break;
602611

603612
case DISPLAY_MODE::CLOCK:
613+
case DISPLAY_MODE::CLOCK_DISPLAY:
604614
mode = DISPLAY_MODE::MENU;
605615
display.setFont(DejaVu_Sans_Mono_12);
606616
display.setTextAlignment(TEXT_ALIGN_LEFT);
@@ -700,6 +710,7 @@ void DisplayUI::draw(bool force) {
700710
drawIntro();
701711
break;
702712
case DISPLAY_MODE::CLOCK:
713+
case DISPLAY_MODE::CLOCK_DISPLAY:
703714
drawClock();
704715
break;
705716
case DISPLAY_MODE::RESETTING:

esp8266_deauther/DisplayUI.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ enum class DISPLAY_MODE { OFF,
7777
PACKETMONITOR,
7878
INTRO,
7979
CLOCK,
80+
CLOCK_DISPLAY,
8081
RESETTING };
8182

8283
class DisplayUI {
@@ -156,6 +157,7 @@ class DisplayUI {
156157
Menu scanMenu;
157158
Menu showMenu;
158159
Menu attackMenu;
160+
Menu clockMenu;
159161

160162
Menu apListMenu;
161163
Menu stationListMenu;

esp8266_deauther/language.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ const char D_SHOW[] PROGMEM = "SELECT";
365365
const char D_ATTACK[] PROGMEM = "ATTACK";
366366
const char D_PACKET_MONITOR[] PROGMEM = "PACKET MONITOR";
367367
const char D_CLOCK[] PROGMEM = "CLOCK";
368+
const char D_CLOCK_DISPLAY[] PROGMEM = "CLOCK DISPLAY";
369+
const char D_CLOCK_SET[] PROGMEM = "SET CLOCK";
368370

369371
// SCAN MENU
370372
const char D_SCAN_APST[] PROGMEM = "SCAN AP + ST";

0 commit comments

Comments
 (0)