mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-11-10 16:46:17 -05:00
Add an init routine to the menu struct
This commit is contained in:
parent
cc763a0dce
commit
ecc3b9c1fb
1
menu.h
1
menu.h
@ -16,6 +16,7 @@ enum ButtonPress_e : uint8_t {
|
||||
};
|
||||
|
||||
struct Menu_t {
|
||||
void (*const initMenu)();//Any initial draw routines or state initialization
|
||||
MenuReturn_e (*const runMenu)(const ButtonPress_e tuner_button,
|
||||
const ButtonPress_e touch_button,
|
||||
const Point touch_point,
|
||||
|
@ -13,23 +13,15 @@
|
||||
#include "ubitx.h"//THRESHOLD_USB_LSB
|
||||
#include "utils.h"
|
||||
|
||||
//The startup menu stuff is a little hack to render the main screen on boot
|
||||
MenuReturn_e runStartupMenu(const ButtonPress_e tuner_button,
|
||||
const ButtonPress_e touch_button,
|
||||
const Point touch_point,
|
||||
const int16_t knob);
|
||||
Menu_t startupMenu = {
|
||||
runStartupMenu,
|
||||
nullptr
|
||||
};
|
||||
|
||||
void drawMainMenu(void);
|
||||
MenuReturn_e runMainMenu(const ButtonPress_e tuner_button,
|
||||
const ButtonPress_e touch_button,
|
||||
const Point touch_point,
|
||||
const int16_t knob);
|
||||
Menu_t mainMenu = {
|
||||
drawMainMenu,
|
||||
runMainMenu,
|
||||
&startupMenu
|
||||
nullptr
|
||||
};
|
||||
|
||||
Menu_t* const rootMenu = &mainMenu;
|
||||
|
@ -479,7 +479,7 @@ void setup()
|
||||
runBfoSetting();
|
||||
}
|
||||
|
||||
guiUpdate();
|
||||
rootMenu->initMenu();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user