Add linkstats to module display (#2843)
[ExpressLRS.git] / src / lib / SCREEN / menu.h
blob8fdb49617011920f294d9302a46d628c32820d65
2 #include "fsm.h"
4 // -------------- States --------------
6 enum fsm_state_s {
7 // This first ones have menu text & icons (and are used as array indexes)
8 STATE_PACKET = 0,
9 STATE_SWITCH,
10 STATE_ANTENNA,
11 STATE_POWER,
12 STATE_TELEMETRY,
13 STATE_POWERSAVE,
14 STATE_SMARTFAN,
15 STATE_JOYSTICK,
16 STATE_BIND,
17 STATE_WIFI,
18 STATE_VTX,
19 STATE_LINKSTATS,
21 STATE_POWER_MAX,
22 STATE_POWER_DYNAMIC,
24 STATE_VTX_BAND,
25 STATE_VTX_CHANNEL,
26 STATE_VTX_POWER,
27 STATE_VTX_PITMODE,
28 STATE_VTX_SEND,
30 STATE_WIFI_TX,
31 STATE_WIFI_RX,
32 STATE_WIFI_BACKPACK,
33 STATE_WIFI_VRX,
36 // These do not have menu text or icons
37 STATE_SPLASH = 100,
38 STATE_IDLE,
39 STATE_TELEMETRY_CURR,
41 STATE_BLE_CONFIRM,
42 STATE_BLE_EXECUTE,
43 STATE_BLE_EXIT,
45 STATE_WIFI_CONFIRM,
46 STATE_WIFI_EXECUTE,
47 STATE_WIFI_EXIT,
49 STATE_BIND_CONFIRM,
50 STATE_BIND_EXECUTE,
52 STATE_VTX_SAVE,
53 STATE_VTX_SAVESEND,
55 STATE_VALUE_INIT,
56 STATE_VALUE_SELECT,
57 STATE_VALUE_INC,
58 STATE_VALUE_DEC,
59 STATE_VALUE_SAVE,
63 // -------------- Events --------------
64 #define LONG_PRESSED 0x40
66 #define EVENT_ENTER 0
67 #define EVENT_UP 1
68 #define EVENT_DOWN 2
69 #define EVENT_LEFT 3
70 #define EVENT_RIGHT 4
71 #define EVENT_LONG_ENTER (EVENT_ENTER | LONG_PRESSED)
72 #define EVENT_LONG_UP (EVENT_UP | LONG_PRESSED)
73 #define EVENT_LONG_DOWN (EVENT_DOWN | LONG_PRESSED)
74 #define EVENT_LONG_LEFT (EVENT_LEFT | LONG_PRESSED)
75 #define EVENT_LONG_RIGHT (EVENT_RIGHT | LONG_PRESSED)
77 extern fsm_state_entry_t const entry_fsm[];
78 extern fsm_state_entry_t const vtx_menu_fsm[];
79 extern fsm_state_entry_t const value_select_fsm[];
81 fsm_state_t getInitialState();