diff --git a/UI/UI_Idle.c b/UI/UI_Idle.c index 5b5cc14..a56d18b 100644 --- a/UI/UI_Idle.c +++ b/UI/UI_Idle.c @@ -259,8 +259,9 @@ void IdleProcess(DisplayTaskMessage_Type msg) BSP_MainPowerEnable(1); LCD_WR_REG(0x29); //Display on - LCD_WR_PIC_FROM_FLASH(40, 50, EXTFLASH_CHARGING_W, EXTFLASH_CHARGING_H, - EXTFLASH_CHARGING_ADDR); + /* 0904 全屏充电画面(UI0902 资源包);旧 Charg.bin 160x190 仅作音色包占位 */ + LCD_WR_PIC_FROM_FLASH(0, 0, UI0902_CHARGE_SCREEN_W, UI0902_CHARGE_SCREEN_H, + UI0902_CHARGE_SCREEN_ADDR); LCD_BLK_Set(); flag = 1; } @@ -268,7 +269,10 @@ void IdleProcess(DisplayTaskMessage_Type msg) { uint8_t Info[10] = {0,}; sprintf ((char*)Info, "%d%%", msg.ID); - LCD_ShowString_AutoAlign(0,240,250,Info,LCD_ALIGN_CENTER,WHITE,BLACK,0,28); + /* 设计稿百分比约 y270;清带避免 9%→100% 残影 */ + LCD_FillByColor(40, 265, 200, 298, UI0902_BG_COLOR); + LCD_ShowString_AutoAlign(0, 240, 270, Info, LCD_ALIGN_CENTER, + WHITE, UI0902_BG_COLOR, 0, 28); } //else //BSP_MainPowerEnable(0); diff --git a/project/inc/UI0902_Res_Addr.h b/project/inc/UI0902_Res_Addr.h index 3029131..4b91bdd 100644 --- a/project/inc/UI0902_Res_Addr.h +++ b/project/inc/UI0902_Res_Addr.h @@ -280,7 +280,11 @@ #define UI0902_BOOT_LOGO_W 240 #define UI0902_BOOT_LOGO_H 320 -#define UI0902_BTN_CANCEL_BIG_ADDR (UI0902_RES_BASE + 0x0AC000UL) /* 11872 bytes */ +#define UI0902_CHARGE_SCREEN_ADDR (UI0902_RES_BASE + 0x0AC000UL) /* 153600 bytes */ +#define UI0902_CHARGE_SCREEN_W 240 +#define UI0902_CHARGE_SCREEN_H 320 + +#define UI0902_BTN_CANCEL_BIG_ADDR (UI0902_RES_BASE + 0x0D2000UL) /* 11872 bytes */ #define UI0902_BTN_CANCEL_BIG_W 106 #define UI0902_BTN_CANCEL_BIG_H 56 diff --git a/tools/assets_0902/08_充电界面/充电界面-0902-09.png b/tools/assets_0902/08_充电界面/充电界面-0902-09.png new file mode 100644 index 0000000..c4d6c73 Binary files /dev/null and b/tools/assets_0902/08_充电界面/充电界面-0902-09.png differ diff --git a/tools/gen_ui0902_assets.py b/tools/gen_ui0902_assets.py index fd469ee..5b2f47a 100644 --- a/tools/gen_ui0902_assets.py +++ b/tools/gen_ui0902_assets.py @@ -10,6 +10,7 @@ Outputs: """ from PIL import Image, ImageDraw, ImageFont from pathlib import Path +import sys ROOT = Path(__file__).resolve().parents[1] SRC = ROOT / "tools" / "assets_0902" @@ -109,6 +110,9 @@ def make_cancel_button(): # ---------------- internal flash (small, high-frequency icons) ---------------- +# NOTE: MCU-internal icon set in Drv_ILI9341_Lcd_Image_UI0902.c/.h may include +# extra hand-tuned symbols (tri/btn). Prefer --ext-only to refresh ExtFlash map +# without wiping those arrays. INTERNAL = [ ("gImage_UI0902_Volume_20x15", "02_顶部图标/音量图标-10.png"), ("gImage_UI0902_Bluetooth_11x17", "02_顶部图标/蓝牙图标-10.png"), @@ -194,38 +198,45 @@ EXTERNAL = [ ("TXT_RESTORE_V2", "06_控件/文字/文字-25.png"), ("TXT_RESTORE_H", "06_控件/文字/文字-26.png"), ("TXT_RESTORE_CONFIRM", "06_控件/文字/文字-27.png"), - # 整屏开机 Logo(避开旧 0x0 / 充电 0xCB70 区,挂在 ui0902 资源包末尾) + # 整屏开机 Logo / 充电画面(避开旧 0x0 / Charg.bin 0xCB70 区,挂在 ui0902 资源包) ("BOOT_LOGO", "07_开机/开机界面-20.png"), + ("CHARGE_SCREEN", "08_充电界面/充电界面-0902-09.png"), # 0904 最新全屏充电稿;百分比重叠由固件绘制 ] def main(): + ext_only = "--ext-only" in sys.argv + # ---- internal flash C arrays ---- - c_lines = ['#include "Drv_ILI9341_Lcd_Image_UI0902.h"', "", - "/* Auto-generated by tools/gen_ui0902_assets.py. Do not hand-edit. */", ""] - h_lines = ["#ifndef __DRV_ILI9341_LCD_IMAGE_UI0902_H", - "#define __DRV_ILI9341_LCD_IMAGE_UI0902_H", "", - '#include "stdint.h"', ""] - total_int = 0 + if not ext_only: + c_lines = ['#include "Drv_ILI9341_Lcd_Image_UI0902.h"', "", + "/* Auto-generated by tools/gen_ui0902_assets.py. Do not hand-edit. */", ""] + h_lines = ["#ifndef __DRV_ILI9341_LCD_IMAGE_UI0902_H", + "#define __DRV_ILI9341_LCD_IMAGE_UI0902_H", "", + '#include "stdint.h"', ""] + total_int = 0 - data, w, h = rgba_to_rgb565(make_battery_outline()) - emit_c_array(c_lines, "gImage_UI0902_BatteryOutline_29x12", data, w, h) - h_lines.append("extern const unsigned char gImage_UI0902_BatteryOutline_29x12[];") - total_int += len(data) - - data, w, h = rgba_to_rgb565(make_battery_fill()) - emit_c_array(c_lines, "gImage_UI0902_BatteryFill_22x9", data, w, h) - h_lines.append(f"extern const unsigned char gImage_UI0902_BatteryFill_22x9[{len(data)}];") - total_int += len(data) - - for name, rel in INTERNAL: - data, w, h = rgba_to_rgb565(Image.open(SRC / rel)) - emit_c_array(c_lines, name, data, w, h) - h_lines.append(f"extern const unsigned char {name}[{len(data)}];") + data, w, h = rgba_to_rgb565(make_battery_outline()) + emit_c_array(c_lines, "gImage_UI0902_BatteryOutline_29x12", data, w, h) + h_lines.append("extern const unsigned char gImage_UI0902_BatteryOutline_29x12[];") total_int += len(data) - h_lines += ["", "#endif", ""] - OUT_H.write_text("\n".join(h_lines), encoding="utf-8") - OUT_C.write_text("\n".join(c_lines), encoding="utf-8") + + data, w, h = rgba_to_rgb565(make_battery_fill()) + emit_c_array(c_lines, "gImage_UI0902_BatteryFill_22x9", data, w, h) + h_lines.append(f"extern const unsigned char gImage_UI0902_BatteryFill_22x9[{len(data)}];") + total_int += len(data) + + for name, rel in INTERNAL: + data, w, h = rgba_to_rgb565(Image.open(SRC / rel)) + emit_c_array(c_lines, name, data, w, h) + h_lines.append(f"extern const unsigned char {name}[{len(data)}];") + total_int += len(data) + h_lines += ["", "#endif", ""] + OUT_H.write_text("\n".join(h_lines), encoding="utf-8") + OUT_C.write_text("\n".join(c_lines), encoding="utf-8") + print(f"internal flash payload: {total_int} bytes -> {OUT_C.name}") + else: + print("Skip internal C arrays (--ext-only)") # ---- external flash bin ---- addr_lines = ["#ifndef __UI0902_RES_ADDR_H", "#define __UI0902_RES_ADDR_H", "", @@ -239,7 +250,7 @@ def main(): if name in ("ROW_UNIVERSAL_NOT", "ROW_UNIVERSAL_SEL", "ROW_NORMAL_NOT", "ROW_NORMAL_SEL", "ROW_EXPERT_NOT", "ROW_EXPERT_SEL"): im = im.resize(ROW_RESIZE, Image.LANCZOS) data, w, h = rgba_to_rgb565(im) - elif name == "BOOT_LOGO": + elif name in ("BOOT_LOGO", "CHARGE_SCREEN"): if im.size[0] >= 241 and im.size[1] >= 321: im = im.crop((0, 0, 240, 320)) elif im.size != (240, 320): @@ -265,7 +276,6 @@ def main(): OUT_ADDR.write_text("\n".join(addr_lines), encoding="utf-8") OUT_BIN.write_bytes(bytes(blob)) - print(f"internal flash payload: {total_int} bytes -> {OUT_C.name}") print(f"external flash payload: {len(blob)} bytes ({len(entries)} images) -> {OUT_BIN.name}") print(f"addr header -> {OUT_ADDR}") diff --git a/tools/pack_extflash_tone_0903.py b/tools/pack_extflash_tone_0903.py index d6683e2..3ea4b77 100644 --- a/tools/pack_extflash_tone_0903.py +++ b/tools/pack_extflash_tone_0903.py @@ -4,7 +4,7 @@ Layout (absolute W25Q128 offsets): 0x00000000 logo.bin (legacy pad; boot UI uses UI0902 full-screen logo) - 0x0000CB70 Charg.bin (160x190 RGB565 charging art) + 0x0000CB70 Charg.bin (legacy pad; charge UI uses UI0902_CHARGE_SCREEN full-screen) 0x0001B8F0 1.bin 普通/专业 31 rhythms 0x0009D07D 2.bin 海阔天空 0x000A8607 3.bin 万能模式 @@ -42,7 +42,7 @@ def main() -> None: ziliao = find_ziliao() parts = [ ("LOGO", ziliao / "logo.bin", 0x00000000, "legacy pad; boot uses UI0902_BOOT_LOGO"), - ("CHARGING", ziliao / "Charg.bin", 0x0000CB70, "160x190 RGB565"), + ("CHARGING", ziliao / "Charg.bin", 0x0000CB70, "legacy pad; UI uses UI0902_CHARGE_SCREEN"), ("BIN1_RHYTHM", TONE_DIR / "1.bin", 0x0001B8F0, "普通/专业 31 条节奏"), ("BIN2_SONG_HAITIAN", TONE_DIR / "2.bin", None, "本地曲目 海阔天空"), ("BIN3_UNIVERSAL", TONE_DIR / "3.bin", None, "万能模式"), diff --git a/tools/publish_k1_release.py b/tools/publish_k1_release.py index 6e22e8c..fc7e55e 100644 --- a/tools/publish_k1_release.py +++ b/tools/publish_k1_release.py @@ -143,7 +143,7 @@ def main() -> None: "说明:", " - 只刷音色 .res、不刷 UI0902 时,模式选择页会花屏(读图地址在 0x100000)。", " - 本机开发板若早已刷过 UI0902,只更新音色+MCU 仍可能正常;同事空片/整片擦除会中招。", - " - 开机全屏 Logo 在 UI0902,不在音色包里的 logo.bin 占位。", + " - 开机全屏 Logo、关机充电全屏画面在 UI0902,不在音色包里的 logo.bin/Charg.bin 占位。", " - AutoBand 0x9EB5F 本版未重排。", "", "附件: SoundWalkerIAP.exe / 升级步骤.docx / FLASH_MAP.txt",