From 2782665ad8242d224be5be83f661a293ae7dad25 Mon Sep 17 00:00:00 2001 From: Renze Nicolai Date: Fri, 3 Jun 2022 04:39:49 +0200 Subject: [PATCH] Add menu item and placeholder action for hatchery --- main/CMakeLists.txt | 1 + main/menus/dev.c | 2 +- main/menus/launcher.c | 2 +- main/menus/settings.c | 2 +- main/menus/start.c | 14 +++++++++++++- main/menus/wifi.c | 2 +- resources/icons/hatchery.png | Bin 0 -> 725 bytes 7 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 resources/icons/hatchery.png diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 209ea43..2c6644e 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -37,6 +37,7 @@ idf_component_register( ${project_dir}/resources/icons/home.png ${project_dir}/resources/icons/settings.png ${project_dir}/resources/icons/apps.png + ${project_dir}/resources/icons/hatchery.png ${project_dir}/resources/animation/animation_frame_1.png ${project_dir}/resources/animation/animation_frame_2.png ${project_dir}/resources/animation/animation_frame_3.png diff --git a/main/menus/dev.c b/main/menus/dev.c index ff341e8..016dc06 100644 --- a/main/menus/dev.c +++ b/main/menus/dev.c @@ -43,7 +43,7 @@ void render_dev_help(pax_buf_t* pax_buffer) { } void menu_dev(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341) { - menu_t* menu = menu_alloc("Development tools", 32, 18); + menu_t* menu = menu_alloc("Development tools", 34, 18); menu->fgColor = 0xFF000000; menu->bgColor = 0xFFFFFFFF; diff --git a/main/menus/launcher.c b/main/menus/launcher.c index 25c7e44..b9f204e 100644 --- a/main/menus/launcher.c +++ b/main/menus/launcher.c @@ -30,7 +30,7 @@ typedef struct { } menu_launcher_args_t; void menu_launcher(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341) { - menu_t* menu = menu_alloc("Apps", 32, 18); + menu_t* menu = menu_alloc("Apps", 34, 18); menu->fgColor = 0xFF000000; menu->bgColor = 0xFFFFFFFF; diff --git a/main/menus/settings.c b/main/menus/settings.c index fadddc3..2057e65 100644 --- a/main/menus/settings.c +++ b/main/menus/settings.c @@ -42,7 +42,7 @@ void render_settings_help(pax_buf_t* pax_buffer) { } void menu_settings(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341) { - menu_t* menu = menu_alloc("Settings", 32, 18); + menu_t* menu = menu_alloc("Settings", 34, 18); menu->fgColor = 0xFF000000; menu->bgColor = 0xFFFFFFFF; diff --git a/main/menus/start.c b/main/menus/start.c index 533cdf3..5de0a34 100644 --- a/main/menus/start.c +++ b/main/menus/start.c @@ -16,6 +16,7 @@ #include "launcher.h" #include "settings.h" #include "dev.h" +#include "bootscreen.h" extern const uint8_t home_png_start[] asm("_binary_home_png_start"); extern const uint8_t home_png_end[] asm("_binary_home_png_end"); @@ -23,6 +24,9 @@ extern const uint8_t home_png_end[] asm("_binary_home_png_end"); extern const uint8_t apps_png_start[] asm("_binary_apps_png_start"); extern const uint8_t apps_png_end[] asm("_binary_apps_png_end"); +extern const uint8_t hatchery_png_start[] asm("_binary_hatchery_png_start"); +extern const uint8_t hatchery_png_end[] asm("_binary_hatchery_png_end"); + extern const uint8_t dev_png_start[] asm("_binary_dev_png_start"); extern const uint8_t dev_png_end[] asm("_binary_dev_png_end"); @@ -32,6 +36,7 @@ extern const uint8_t settings_png_end[] asm("_binary_settings_png_end"); typedef enum action { ACTION_NONE, ACTION_APPS, + ACTION_HATCHERY, ACTION_DEV, ACTION_SETTINGS } menu_start_action_t; @@ -44,7 +49,7 @@ void render_start_help(pax_buf_t* pax_buffer) { } void menu_start(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341) { - menu_t* menu = menu_alloc("Main menu", 32, 18); + menu_t* menu = menu_alloc("Main menu", 34, 18); menu->fgColor = 0xFF000000; menu->bgColor = 0xFFFFFFFF; @@ -60,6 +65,8 @@ void menu_start(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili934 pax_decode_png_buf(&icon_home, (void*) home_png_start, home_png_end - home_png_start, PAX_BUF_32_8888ARGB, 0); pax_buf_t icon_apps; pax_decode_png_buf(&icon_apps, (void*) apps_png_start, apps_png_end - apps_png_start, PAX_BUF_32_8888ARGB, 0); + pax_buf_t icon_hatchery; + pax_decode_png_buf(&icon_hatchery, (void*) hatchery_png_start, hatchery_png_end - hatchery_png_start, PAX_BUF_32_8888ARGB, 0); pax_buf_t icon_dev; pax_decode_png_buf(&icon_dev, (void*) dev_png_start, dev_png_end - dev_png_start, PAX_BUF_32_8888ARGB, 0); pax_buf_t icon_settings; @@ -68,6 +75,7 @@ void menu_start(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili934 menu_set_icon(menu, &icon_home); menu_insert_item_icon(menu, "Apps", NULL, (void*) ACTION_APPS, -1, &icon_apps); + menu_insert_item_icon(menu, "Hatchery", NULL, (void*) ACTION_HATCHERY, -1, &icon_hatchery); menu_insert_item_icon(menu, "Development tools", NULL, (void*) ACTION_DEV, -1, &icon_dev); menu_insert_item_icon(menu, "Settings", NULL, (void*) ACTION_SETTINGS, -1, &icon_settings); @@ -117,6 +125,9 @@ void menu_start(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili934 if (action != ACTION_NONE) { if (action == ACTION_APPS) { menu_launcher(buttonQueue, pax_buffer, ili9341); + } else if (action == ACTION_HATCHERY) { + // Not implemented + display_boot_screen(pax_buffer, ili9341, "Not implemented"); } else if (action == ACTION_SETTINGS) { menu_settings(buttonQueue, pax_buffer, ili9341); } else if (action == ACTION_DEV) { @@ -131,6 +142,7 @@ void menu_start(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili934 menu_free(menu); pax_buf_destroy(&icon_home); pax_buf_destroy(&icon_apps); + pax_buf_destroy(&icon_hatchery); pax_buf_destroy(&icon_dev); pax_buf_destroy(&icon_settings); } diff --git a/main/menus/wifi.c b/main/menus/wifi.c index 3c8aec5..d612074 100644 --- a/main/menus/wifi.c +++ b/main/menus/wifi.c @@ -73,7 +73,7 @@ int wifi_auth_menu(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili int wifi_phase2_menu(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341, esp_eap_ttls_phase2_types default_mode); void menu_wifi(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341) { - menu_t* menu = menu_alloc("WiFi configuration", 32, 18); + menu_t* menu = menu_alloc("WiFi configuration", 34, 18); menu_insert_item(menu, "Show current settings", NULL, (void*) ACTION_SHOW, -1); menu_insert_item(menu, "Scan for networks", NULL, (void*) ACTION_SCAN, -1); menu_insert_item(menu, "Configure manually", NULL, (void*) ACTION_MANUAL, -1); diff --git a/resources/icons/hatchery.png b/resources/icons/hatchery.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf5a6a5a5a973af43f9f0c98612ba60439796fb GIT binary patch literal 725 zcmV;`0xJE9P)&sPGI<#o1hyNqc-F<+2|$ES0AsmUT&!1fjdqp| z0N4dEpWQNAOc-47Qu#JgPJj@=`>B_6#e_rCL+N~5=%)Np%ZD&p-|p{0SYxFok^(-i z;d<33z$U zTMa@)%vjx*>#o)!b2c)GGuaW@r7<;fJbG>XU)nyF;0F)fOR4dOwx}d83^>oJq00000NkvXX Hu0mjf^j$uu literal 0 HcmV?d00001