Add optional cyd_35r (ESP32-3248S035) with 480x320 UI; default remains 2.8.

This commit is contained in:
2026-10-23 16:24:20 +08:00
parent 2d7594d0b8
commit 53d75317dd
4 changed files with 91 additions and 32 deletions

View File

@@ -95,41 +95,41 @@ void ui_create() {
lv_label_set_text(lbl_title, "Touch");
lv_obj_set_style_text_color(lbl_title, lv_color_hex(COL_INK), 0);
lv_obj_set_style_text_font(lbl_title, &lv_font_montserrat_28, 0);
lv_obj_align(lbl_title, LV_ALIGN_TOP_MID, 0, 2);
lv_obj_align(lbl_title, LV_ALIGN_TOP_MID, UX(0), UY(2));
lbl_pin = lv_label_create(scr);
lv_label_set_text_fmt(lbl_pin, "Cap OUT->GPIO%d 3.3V", BTN_PIN);
lv_obj_set_style_text_color(lbl_pin, lv_color_hex(COL_MUTED), 0);
lv_obj_set_style_text_font(lbl_pin, &lv_font_montserrat_14, 0);
lv_obj_align(lbl_pin, LV_ALIGN_TOP_MID, 0, 32);
lv_obj_align(lbl_pin, LV_ALIGN_TOP_MID, UX(0), UY(32));
lbl_count = lv_label_create(scr);
lv_label_set_text(lbl_count, "0");
lv_obj_set_style_text_color(lbl_count, lv_color_hex(COL_ACCENT), 0);
lv_obj_set_style_text_font(lbl_count, &lv_font_montserrat_28, 0);
lv_obj_align(lbl_count, LV_ALIGN_TOP_MID, 0, 56);
lv_obj_align(lbl_count, LV_ALIGN_TOP_MID, UX(0), UY(56));
lbl_hint = lv_label_create(scr);
lv_label_set_text(lbl_hint, "count");
lv_obj_set_style_text_color(lbl_hint, lv_color_hex(COL_MUTED), 0);
lv_obj_set_style_text_font(lbl_hint, &lv_font_montserrat_14, 0);
lv_obj_align(lbl_hint, LV_ALIGN_TOP_MID, 0, 90);
lv_obj_align(lbl_hint, LV_ALIGN_TOP_MID, UX(0), UY(90));
lbl_state = lv_label_create(scr);
lv_label_set_text(lbl_state, "IDLE");
lv_obj_set_style_text_color(lbl_state, lv_color_hex(COL_MUTED), 0);
lv_obj_set_style_text_font(lbl_state, &lv_font_montserrat_20, 0);
lv_obj_align(lbl_state, LV_ALIGN_TOP_MID, 0, 110);
lv_obj_align(lbl_state, LV_ALIGN_TOP_MID, UX(0), UY(110));
lbl_hold = lv_label_create(scr);
lv_label_set_text(lbl_hold, "hold --");
lv_obj_set_style_text_color(lbl_hold, lv_color_hex(COL_MUTED), 0);
lv_obj_set_style_text_font(lbl_hold, &lv_font_montserrat_14, 0);
lv_obj_align(lbl_hold, LV_ALIGN_TOP_MID, 0, 134);
lv_obj_align(lbl_hold, LV_ALIGN_TOP_MID, UX(0), UY(134));
bar_touch = lv_bar_create(scr);
lv_obj_set_size(bar_touch, UI_HOR_RES - 64, 10);
lv_obj_align(bar_touch, LV_ALIGN_TOP_MID, 0, 154);
lv_obj_set_size(bar_touch, UI_HOR_RES - UW(64), UH(10));
lv_obj_align(bar_touch, LV_ALIGN_TOP_MID, UX(0), UY(154));
lv_bar_set_range(bar_touch, 0, 100);
lv_bar_set_value(bar_touch, 0, LV_ANIM_OFF);
lv_obj_set_style_radius(bar_touch, 5, 0);
@@ -143,11 +143,11 @@ void ui_create() {
lv_label_set_text(lbl_raw, "OUT --");
lv_obj_set_style_text_color(lbl_raw, lv_color_hex(COL_MUTED), 0);
lv_obj_set_style_text_font(lbl_raw, &lv_font_montserrat_14, 0);
lv_obj_align(lbl_raw, LV_ALIGN_TOP_MID, 0, 170);
lv_obj_align(lbl_raw, LV_ALIGN_TOP_MID, UX(0), UY(170));
btn_reset = lv_button_create(scr);
lv_obj_set_size(btn_reset, UI_HOR_RES - 48, 40);
lv_obj_align(btn_reset, LV_ALIGN_TOP_MID, 0, 192);
lv_obj_set_size(btn_reset, UI_HOR_RES - UW(48), UH(40));
lv_obj_align(btn_reset, LV_ALIGN_TOP_MID, UX(0), UY(192));
style_btn(btn_reset, COL_BTN);
lv_obj_set_ext_click_area(btn_reset, 12);
lv_obj_add_event_cb(btn_reset, on_reset, LV_EVENT_CLICKED, nullptr);