General: - Rename control mode MENU to MENU_SETTINGS - Add new control mode MENU_MODE_SELECT Button menu: - change 'long press' to: 'switch to menu mode-select' - move 'open settings menu' to 5x press Display: - display_task: outsource statusScreen to local function - display_task: also handle MENU_MODE_SELECT control mode - show display startup message for 2600ms instead of 2000ms Menu: - Add functions to handle modeSelect menu to select from a list of allowed modes (similar to settings main menu)
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "display.hpp"
|
|
|
|
|
|
//--- menuState_t ---
|
|
// modes the menu can be in
|
|
typedef enum {
|
|
MAIN_MENU = 0,
|
|
SET_VALUE
|
|
} menuState_t;
|
|
|
|
|
|
//--- menuItem_t ---
|
|
// struct describes one menu element (all defined in menu.cpp)
|
|
typedef struct
|
|
{
|
|
void (*action)(display_task_parameters_t * objects, SSD1306_t * display, int value); // pointer to function run when confirmed
|
|
int (*currentValue)(display_task_parameters_t * objects); // pointer to function to get currently configured value
|
|
int (*defaultValue)(display_task_parameters_t * objects); // pointer to function to get currently configured value
|
|
int valueMin; // min allowed value
|
|
int valueMax; // max allowed value
|
|
int valueIncrement; // amount changed at one encoder tick (+/-)
|
|
const char title[17]; // shown in list
|
|
const char line1[17]; // above value
|
|
const char line2[17]; // above value
|
|
const char line4[17]; // below value *
|
|
const char line5[17]; // below value *
|
|
const char line6[17]; // below value
|
|
const char line7[17]; // below value
|
|
} menuItem_t;
|
|
|
|
//controls menu for changing settings with encoder input and displays the text on oled display (has to be repeatedly called by display task)
|
|
void handleMenu_settings(display_task_parameters_t * objects, SSD1306_t *display);
|
|
|
|
//controls menu for selecting the control mode with encoder input and displays the text on oled display (has to be repeatedly called by display task)
|
|
void handleMenu_modeSelect(display_task_parameters_t * objects, SSD1306_t *display); |