xevi/NuEVI/numenu.h
Mikael Degerfält 0d0ea5051d Made the sensor adjust menu driven by data
* Moved menu titles and option names into data structures.
 * Unified select menu option code
 * Also unified handling of menu selection, although main and rotator menus are still handled the old way.
 * Moved struct definitions to numenu.h
 * Grouped functions and variables together based on usage.
2019-06-23 17:14:17 +02:00

66 lines
1 KiB
C

#ifndef __NUMENU_H
#define __NUMENU_H
//***********************************************************
enum MenuType {
ESub,
ESubRotator,
EStateChange,
};
struct MenuEntry {
enum MenuType type;
const char* title;
};
struct MenuEntrySub {
enum MenuType type;
const char* title;
const char* subTitle;
byte* flag;
void (*subMenuFunc)(int color);
};
struct MenuEntrySubRotator {
enum MenuType type;
const char* title;
const char* subTitle;
byte flagValue;
byte* flag;
void (*subMenuFunc)(int color);
};
struct MenuEntryStateCh {
enum MenuType type;
const char* title;
byte state;
};
struct MenuPage {
const char* title;
byte cursor;
byte parentPage;
byte numEntries;
const MenuEntry** entries;
};
//***********************************************************
struct AdjustValue {
uint16_t *value;
uint16_t limitLow;
uint16_t limitHigh;
};
struct AdjustMenuEntry {
const char* title;
AdjustValue entries[2];
void (*saveFunc)(const AdjustMenuEntry&);
};
#endif