mirror of
https://github.com/jhbruhn/eurorack.git
synced 2025-03-15 02:55:49 +00:00
Remove ui init function
This commit is contained in:
parent
5182a9b495
commit
51da3fc17e
3 changed files with 4 additions and 16 deletions
|
@ -116,7 +116,6 @@ void Init(void)
|
||||||
gpio.Init();
|
gpio.Init();
|
||||||
display.Init();
|
display.Init();
|
||||||
encoder.Init();
|
encoder.Init();
|
||||||
ui.Init();
|
|
||||||
InitTimers();
|
InitTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,16 +10,16 @@
|
||||||
|
|
||||||
using namespace stmlib;
|
using namespace stmlib;
|
||||||
|
|
||||||
#define HEADER_HEIGHT 14
|
|
||||||
const uint32_t kEncoderLongPressTime = 600;
|
const uint32_t kEncoderLongPressTime = 600;
|
||||||
|
|
||||||
|
// TODO: This is kind of ugly, can we improve this somehow?
|
||||||
Part parts[4];
|
Part parts[4];
|
||||||
Part* part_pointers[4] = {&parts[0], &parts[1], &parts[2], &parts[3]};
|
Part* part_pointers[4] = {&parts[0], &parts[1], &parts[2], &parts[3]};
|
||||||
MainMenu mainMenu(part_pointers);
|
MainMenu mainMenu(part_pointers);
|
||||||
|
|
||||||
void UI::Init()
|
UI::UI()
|
||||||
{
|
{
|
||||||
input_queue.Init();
|
this->input_queue.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI::Poll()
|
void UI::Poll()
|
||||||
|
@ -104,5 +104,4 @@ void UI::OnIncrement(Event& e)
|
||||||
mainMenu.down();
|
mainMenu.down();
|
||||||
else
|
else
|
||||||
mainMenu.up();
|
mainMenu.up();
|
||||||
//current_menu = (Menu_t) (((uint32_t)current_menu + e.data) % MENU_COUNT);
|
|
||||||
}
|
}
|
||||||
|
|
12
midi2cv/ui.h
12
midi2cv/ui.h
|
@ -4,26 +4,16 @@
|
||||||
#include "stmlib/stmlib.h"
|
#include "stmlib/stmlib.h"
|
||||||
#include "stmlib/ui/event_queue.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 {
|
class UI {
|
||||||
public:
|
public:
|
||||||
UI() {}
|
UI();
|
||||||
~UI() {}
|
~UI() {}
|
||||||
|
|
||||||
void Init();
|
|
||||||
void Poll();
|
void Poll();
|
||||||
void Flush();
|
void Flush();
|
||||||
void DoEvents();
|
void DoEvents();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Menu_t current_menu;
|
|
||||||
stmlib::EventQueue<16> input_queue;
|
stmlib::EventQueue<16> input_queue;
|
||||||
|
|
||||||
bool long_press_event_sent_;
|
bool long_press_event_sent_;
|
||||||
|
|
Loading…
Reference in a new issue