2020-02-09 22:10:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-02-10 02:41:26 +00:00
|
|
|
#include "point.h"
|
2020-02-09 22:10:08 +00:00
|
|
|
|
|
|
|
enum MenuReturn_e : uint8_t {
|
|
|
|
StillActive,
|
|
|
|
ExitedRedraw,
|
|
|
|
ExitedNoRedraw
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ButtonPress_e : uint8_t {
|
|
|
|
NotPressed,
|
|
|
|
ShortPress,
|
|
|
|
LongPress
|
2020-02-09 23:30:37 +00:00
|
|
|
};
|
2020-02-09 22:10:08 +00:00
|
|
|
|
|
|
|
struct Menu_t {
|
2020-02-10 06:01:19 +00:00
|
|
|
void (*const initMenu)();//Any initial draw routines or state initialization
|
2020-02-09 23:30:37 +00:00
|
|
|
MenuReturn_e (*const runMenu)(const ButtonPress_e tuner_button,
|
|
|
|
const ButtonPress_e touch_button,
|
|
|
|
const Point touch_point,
|
|
|
|
const int16_t knob);
|
2020-02-09 22:10:08 +00:00
|
|
|
Menu_t* active_submenu;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint8_t MENU_KNOB_COUNTS_PER_ITEM = 10;
|
2020-02-15 22:43:05 +00:00
|
|
|
|
|
|
|
void runActiveMenu(const ButtonPress_e tuner_button,
|
|
|
|
const ButtonPress_e touch_button,
|
|
|
|
const Point touch_point,
|
|
|
|
const int16_t knob);
|