Skip to content

Commit 0005a3b

Browse files
committed
update main bootloader
1 parent 9eb3516 commit 0005a3b

File tree

6 files changed

+16
-425
lines changed

6 files changed

+16
-425
lines changed

main/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
idf_component_register(SRCS
22
"bootloader_ui.c"
33
"graphical_bootloader_main.c"
4-
"image/icon_about_us.c"
54

65
INCLUDE_DIRS
76
".")
7+
8+
lvgl_port_create_c_image("../resources/images/icon_tic_tac_toe.png" "images/gen/" "ARGB8888" "NONE")
9+
lvgl_port_add_images(${COMPONENT_LIB} "images/gen/")

main/bootloader_ui.c

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static lv_obj_t *g_page_menu = NULL;
3737
static lv_obj_t *g_focus_last_obj = NULL;
3838
static lv_obj_t *g_group_list[3] = {0};
3939

40-
LV_IMG_DECLARE(icon_about_us)
40+
LV_IMG_DECLARE(icon_tic_tac_toe)
4141
// LV_IMG_DECLARE(icon_app2)
4242
// LV_IMG_DECLARE(icon_app3)
4343
// LV_IMG_DECLARE(icon_app4)
@@ -50,11 +50,11 @@ void ui_app4_start(void (*fn)(void));
5050
void ui_app5_start(void (*fn)(void));
5151

5252
static item_desc_t item[] = {
53-
{ "App1", (void *) &icon_about_us, ui_app1_start, NULL},
54-
{ "App2", (void *) &icon_about_us, ui_app2_start, NULL},
55-
{ "App3", (void *) &icon_about_us, ui_app3_start, NULL},
56-
{ "App4", (void *) &icon_about_us, ui_app4_start, NULL},
57-
{ "App5", (void *) &icon_about_us, ui_app5_start, NULL},
53+
{ "Tic-Tac-Toe", (void *) &icon_tic_tac_toe, ui_app1_start, NULL},
54+
{ "App2", (void *) &icon_tic_tac_toe, ui_app2_start, NULL},
55+
{ "App3", (void *) &icon_tic_tac_toe, ui_app3_start, NULL},
56+
{ "App4", (void *) &icon_tic_tac_toe, ui_app4_start, NULL},
57+
{ "App5", (void *) &icon_tic_tac_toe, ui_app5_start, NULL},
5858
};
5959

6060
static lv_obj_t *g_img_btn, *g_img_item = NULL;
@@ -129,16 +129,6 @@ static void ui_button_style_init(void)
129129
lv_style_set_shadow_ofs_x(&g_btn_styles.style, 0);
130130
lv_style_set_shadow_ofs_y(&g_btn_styles.style, 0);
131131

132-
// lv_style_set_pad_all(&g_btn_styles.style, 10);
133-
134-
// lv_style_set_outline_width(&g_btn_styles.style, 1);
135-
// lv_style_set_outline_opa(&g_btn_styles.style, LV_OPA_COVER);
136-
// lv_style_set_outline_color(&g_btn_styles.style, lv_palette_main(LV_PALETTE_RED));
137-
138-
139-
// lv_style_set_text_color(&g_btn_styles.style, lv_color_white());
140-
// lv_style_set_pad_all(&g_btn_styles.style, 10);
141-
142132
/*Init the pressed style*/
143133

144134
lv_style_init(&g_btn_styles.style_pr);
@@ -159,14 +149,6 @@ static void ui_button_style_init(void)
159149

160150
static void ui_status_bar_set_visible(bool visible)
161151
{
162-
// if (visible) {
163-
// // update all state
164-
// ui_main_status_bar_set_wifi(app_wifi_is_connected());
165-
// ui_main_status_bar_set_cloud(app_rmaker_is_connected());
166-
// lv_obj_clear_flag(g_status_bar, LV_OBJ_FLAG_HIDDEN);
167-
// } else {
168-
// lv_obj_add_flag(g_status_bar, LV_OBJ_FLAG_HIDDEN);
169-
// }
170152
}
171153

172154
static int8_t menu_direct_probe(lv_obj_t *focus_obj)
@@ -477,23 +459,9 @@ void bootloader_ui(lv_obj_t *scr) {
477459
lv_obj_set_style_shadow_width(g_status_bar, 0, LV_PART_MAIN);
478460
lv_obj_align(g_status_bar, LV_ALIGN_TOP_MID, 0, 0);
479461

480-
// lv_obj_t *lab_time = lv_label_create(g_status_bar);
481-
// lv_label_set_text_static(lab_time, "23:59");
482-
// lv_obj_align(lab_time, LV_ALIGN_LEFT_MID, 0, 0);
483-
// lv_timer_t *timer = lv_timer_create(clock_run_cb, 1000, (void *) lab_time);
484-
// clock_run_cb(timer);
485-
486-
// g_lab_wifi = lv_label_create(g_status_bar);
487-
// lv_obj_align_to(g_lab_wifi, lab_time, LV_ALIGN_OUT_RIGHT_MID, 10, 0);
488-
489-
// g_lab_cloud = lv_label_create(g_status_bar);
490-
// lv_obj_set_style_text_font(g_lab_cloud, &font_icon_16, LV_PART_MAIN);
491-
// lv_obj_align_to(g_lab_cloud, g_lab_wifi, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
492-
493462
ui_status_bar_set_visible(0);
494463

495464
ui_main_menu(g_item_index);
496465

497466
ui_release();
498-
// return ESP_OK;
499467
}

main/graphical_bootloader_main.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ void app_main(void)
2525
bsp_display_backlight_on();
2626
// Enter the main loop to process LVGL tasks
2727
while (1) {
28-
// Handle LVGL related tasks
29-
lv_task_handler();
30-
// Delay for a short period of time (e.g., 5 ms)
31-
vTaskDelay(pdMS_TO_TICKS(5));
28+
vTaskDelay(pdMS_TO_TICKS(1000));
3229
}
3330
}

main/idf_component.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
description: ESP32 Graphical Bootloader
22

33
dependencies:
4+
espressif/esp-box: "^3.1.0"
5+
#espressif/esp-box-3: "^1.2.0"
6+
# Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver
7+
esp_codec_dev:
8+
public: true
9+
version: "==1.1.0"
410
#m5stack_core_s3:
511
# version: "^1.0.0"
6-
esp-box-3:
7-
version: "^1.1.3"

0 commit comments

Comments
 (0)