-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate_menu_main.cpp
More file actions
64 lines (51 loc) · 902 Bytes
/
state_menu_main.cpp
File metadata and controls
64 lines (51 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* state_menu_main.cpp
*
* Created on: Apr 2, 2018
* Author: MisterCavespider
*/
#include "state_menu_main.h"
#include "value_bounded.h"
MainMenuState::MainMenuState(StateManager *mgr) : MenuState(mgr, "Main Menu")
{
}
result_t MainMenuState::onAnything()
{
mgr->resetUptime();
return EVENT_IGNORED;
}
result_t MainMenuState::onConfirm(uint8_t flag)
{
switch(menu->getFocus())
{
case 1: // Tuner
mgr->setCurrentState(2);
break;
case 3: // Test GUI
mgr->setCurrentState(4);
break;
}
return SUCCESS;
}
void MainMenuState::isetup()
{
menu->push("Display");
menu->push("Tuner");
menu->push("Editor");
menu->push("Test GUI");
}
void MainMenuState::iloop()
{
// if(needsUpdate)
// {
// menu->update();
// needsUpdate = false;
// return;
// }
if(mgr->getUptime() >= 5000)
{
// mgr->setCurrentState(0); // TitleState
}
}
MainMenuState::~MainMenuState() {
}