feat: add proof-of-concept
This commit is contained in:
+5
-10
@@ -3,20 +3,15 @@
|
||||
#include <Arduino.h>
|
||||
#include "joystick.hpp"
|
||||
|
||||
typedef struct {
|
||||
String name;
|
||||
void (*action)();
|
||||
} Item;
|
||||
|
||||
class Menu {
|
||||
public:
|
||||
Menu(Item* items);
|
||||
void updateCurrentItem(JoystickDirection& direction);
|
||||
void execute();
|
||||
Menu();
|
||||
void setItems(String* items);
|
||||
bool updateCurrentItem(JoystickDirection& direction);
|
||||
|
||||
Item& getItemAt(size_t index);
|
||||
String& getItemAt(size_t index);
|
||||
size_t getCurrentItemIndex() const;
|
||||
private:
|
||||
Item items[MENU_ITEM_COUNT];
|
||||
String items[MENU_ITEM_COUNT];
|
||||
int currentItem;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user