Added functional menu using display and encoder:
- a menu item is defined in one struct
- scroll in a list of defined items
- select option
- modify value
- save value, return to list
Currently only menu is run (button and status display disabled)
- Add menu.cpp/hpp
- Add encoder.cpp/hpp mostly from previous test in board-control
- display.cpp: only run new handleMenu() function
- main.cpp: initialize encoder at startup, disable button task for testing
21 lines
434 B
C++
21 lines
434 B
C++
extern "C" {
|
|
#include "freertos/FreeRTOS.h" // FreeRTOS related headers
|
|
#include "freertos/task.h"
|
|
#include "encoder.h"
|
|
}
|
|
|
|
//config
|
|
#define QUEUE_SIZE 10
|
|
#define PIN_A GPIO_NUM_25
|
|
#define PIN_B GPIO_NUM_26
|
|
#define PIN_BUTTON GPIO_NUM_27
|
|
|
|
//global encoder queue
|
|
extern QueueHandle_t encoderQueue;
|
|
|
|
//init encoder with config in encoder.cpp
|
|
void encoder_init();
|
|
|
|
//task that handles encoder events
|
|
void task_encoderExample(void *arg);
|