|
|
#pragma once
|
|
|
#include <stdint.h>
|
|
|
#include <stdbool.h>
|
|
|
#include "config.h"
|
|
|
#include "events.h"
|
|
|
|
|
|
typedef struct {
|
|
|
void (*nav_short)(int d);
|
|
|
void (*lr_delta)(int d);
|
|
|
void (*draw)(void);
|
|
|
void (*on_tick)(const app_event_t *evt); // NULL if unused
|
|
|
const uint8_t (*icon)[ICON_W]; // 2-page icon [2][ICON_W]
|
|
|
} menu_vtable_t;
|
|
|
|
|
|
// Array index = header slot position (0–NUM_MENU_SLOTS-1).
|
|
|
// NULL = empty/non-interactive slot.
|
|
|
// Last slot (NUM_MENU_SLOTS-1) = FWD+BACK combo to enter/exit.
|
|
|
extern const menu_vtable_t *menus[NUM_MENU_SLOTS];
|
|
|
|
|
|
void menus_init(void);
|
|
|
void menus_nav_short(int d);
|
|
|
void menus_lr_delta(int d);
|
|
|
void menus_draw(void);
|
|
|
|
|
|
// Helpers from main.c exposed for menu_*.c files
|
|
|
void mark_dirty(void);
|
|
|
void restart_life_delta_timer(void);
|
|
|
void restart_idle_timer(void);
|
|
|
void start_reset_cmd_timer(void);
|
|
|
void led_sync(bool changed);
|