Menu work
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "ui.h"
|
||||
#include "usb_host.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
@@ -915,15 +916,6 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
const graphical_menu_t menu_main = {
|
||||
.num_entries = 3,
|
||||
.entries = (graphical_menu_entry_t[]){
|
||||
{.title = "where varock", .enabled = true, .highlighted_callback_function = NULL, .highlighted_callback_function_args = NULL, .selected_callback_function = NULL, .selected_callback_function_args = NULL},
|
||||
{.title = "Settings", .enabled = true, .highlighted_callback_function = NULL, .highlighted_callback_function_args = NULL, .selected_callback_function = NULL, .selected_callback_function_args = NULL},
|
||||
{.title = "About", .enabled = true, .highlighted_callback_function = NULL, .highlighted_callback_function_args = NULL, .selected_callback_function = NULL, .selected_callback_function_args = NULL},
|
||||
}
|
||||
};
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
@@ -939,14 +931,32 @@ void StartDefaultTask(void const * argument)
|
||||
/* USER CODE BEGIN 5 */
|
||||
ILI9341_Init();
|
||||
|
||||
uint8_t time_string[20] = {0};
|
||||
DisplayTest(0xFFFF);
|
||||
draw_menu(&menu_main);
|
||||
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
if (UP_BUTTON_PRESSED())
|
||||
{
|
||||
ui_up_button_pressed();
|
||||
}
|
||||
if (DOWN_BUTTON_PRESSED())
|
||||
{
|
||||
ui_down_button_pressed();
|
||||
}
|
||||
if (LEFT_BUTTON_PRESSED())
|
||||
{
|
||||
ui_left_button_pressed();
|
||||
}
|
||||
if (RIGHT_BUTTON_PRESSED())
|
||||
{
|
||||
ui_right_button_pressed();
|
||||
}
|
||||
if (OK_BUTTON_PRESSED())
|
||||
{
|
||||
ui_ok_button_pressed();
|
||||
}
|
||||
ui_task();
|
||||
osDelay(100);
|
||||
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user