Remove ui init function

This commit is contained in:
Jan-Henrik 2020-02-23 14:28:00 +01:00
parent 5182a9b495
commit 51da3fc17e
3 changed files with 4 additions and 16 deletions

View file

@ -116,7 +116,6 @@ void Init(void)
gpio.Init();
display.Init();
encoder.Init();
ui.Init();
InitTimers();
}

View file

@ -10,16 +10,16 @@
using namespace stmlib;
#define HEADER_HEIGHT 14
const uint32_t kEncoderLongPressTime = 600;
// TODO: This is kind of ugly, can we improve this somehow?
Part parts[4];
Part* part_pointers[4] = {&parts[0], &parts[1], &parts[2], &parts[3]};
MainMenu mainMenu(part_pointers);
void UI::Init()
UI::UI()
{
input_queue.Init();
this->input_queue.Init();
}
void UI::Poll()
@ -104,5 +104,4 @@ void UI::OnIncrement(Event& e)
mainMenu.down();
else
mainMenu.up();
//current_menu = (Menu_t) (((uint32_t)current_menu + e.data) % MENU_COUNT);
}

View file

@ -4,26 +4,16 @@
#include "stmlib/stmlib.h"
#include "stmlib/ui/event_queue.h"
typedef enum {
MENU_PART_1 = 0,
MENU_PART_2,
MENU_PART_3,
MENU_PART_4,
MENU_COUNT
} Menu_t;
class UI {
public:
UI() {}
UI();
~UI() {}
void Init();
void Poll();
void Flush();
void DoEvents();
private:
Menu_t current_menu;
stmlib::EventQueue<16> input_queue;
bool long_press_event_sent_;