commeownder/main/menus.h

31 lines
874 B
C

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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 (0NUM_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);