diff --git a/App/CMakeLists.txt b/App/CMakeLists.txt index 44fd71ed..0850f989 100644 --- a/App/CMakeLists.txt +++ b/App/CMakeLists.txt @@ -214,6 +214,7 @@ if(ENABLE_FEAT_F4HWN_BEAM AND NOT ENABLE_AIRCOPY) message(FATAL_ERROR "ENABLE_FEAT_F4HWN_BEAM requires ENABLE_AIRCOPY (it reuses g_FSK_Buffer, AIRCOPY_Obfuscate and the FSK packet plumbing).") endif() enable_feature(ENABLE_FEAT_F4HWN_QRCODE) +enable_feature(ENABLE_FEAT_F4HWN_LOGO) # ---- DEBUGGING ---- diff --git a/App/driver/eeprom_compat.c b/App/driver/eeprom_compat.c index 39dde9aa..b4cf7bf3 100644 --- a/App/driver/eeprom_compat.c +++ b/App/driver/eeprom_compat.c @@ -67,6 +67,11 @@ static const AddrMapping_t ADDR_MAPPINGS[] = { // Settings Version * 16 Bytes 0x00A160 -> 0x00A170 _MK_MAPPING(0x010000, 0x00B000, 0x00B200), // Calibration 512 Bytes!!! + + _MK_MAPPING(0x011000, 0x00C000, 0x00D000), // Boot Logo sector (4 KB): + // [0x00..0x07] 8-byte header (reserved) + // [0x08..0x407] 128x64 monochrome bitmap, 1024 Bytes + // ST7565-native: 8 pages * 128 columns, column-major LSB-top }; static void AddrTranslate(uint16_t EEPROM_Addr, uint16_t Size, uint32_t *PY25Q16_Addr_out, uint16_t *Size_out, bool *End_out); diff --git a/App/settings.h b/App/settings.h index 81ffa637..07884bae 100644 --- a/App/settings.h +++ b/App/settings.h @@ -34,7 +34,10 @@ enum POWER_OnDisplayMode_t { #endif POWER_ON_DISPLAY_MODE_MESSAGE, POWER_ON_DISPLAY_MODE_VOLTAGE, - POWER_ON_DISPLAY_MODE_NONE +#ifdef ENABLE_FEAT_F4HWN_LOGO + POWER_ON_DISPLAY_MODE_LOGO, +#endif + POWER_ON_DISPLAY_MODE_NONE, }; typedef enum POWER_OnDisplayMode_t POWER_OnDisplayMode_t; diff --git a/App/ui/menu.c b/App/ui/menu.c index 2b5156b6..e0737607 100644 --- a/App/ui/menu.c +++ b/App/ui/menu.c @@ -295,6 +295,9 @@ const char gSubMenu_PONMSG[][8] = #endif "MESSAGE", "VOLTAGE", +#ifdef ENABLE_FEAT_F4HWN_LOGO + "LOGO", +#endif "NONE" }; diff --git a/App/ui/menu.h b/App/ui/menu.h index 0ae007af..10e8b7ff 100644 --- a/App/ui/menu.h +++ b/App/ui/menu.h @@ -211,7 +211,11 @@ extern const char gSubMenu_D_RSP[4][11]; extern const char* const gSubMenu_PTT_ID[5]; #ifdef ENABLE_FEAT_F4HWN - extern const char gSubMenu_PONMSG[5][8]; + #ifdef ENABLE_FEAT_F4HWN_LOGO + extern const char gSubMenu_PONMSG[6][8]; + #else + extern const char gSubMenu_PONMSG[5][8]; + #endif #else extern const char gSubMenu_PONMSG[4][8]; #endif diff --git a/App/ui/welcome.c b/App/ui/welcome.c index 69520590..6dfd0518 100644 --- a/App/ui/welcome.c +++ b/App/ui/welcome.c @@ -33,6 +33,19 @@ #include "screenshot.h" #endif +#ifdef ENABLE_FEAT_F4HWN_LOGO +// Boot logo storage in PY25Q16 external flash, aligned on a 4 KB sector, +// placed past the calibration zone (0x010000-0x010200). +// +// Layout inside the sector starting at LOGO_FLASH_ADDR: +// [0x00..0x07] : 8-byte header (reserved for future magic/version/flags) +// [0x08..0x407]: 128x64 monochrome bitmap (1024 B) +// ST7565-native: 8 pages * 128 columns, column-major LSB-top +#define LOGO_FLASH_ADDR 0x011000 +#define LOGO_HEADER_SIZE 8 +#define LOGO_BITMAP_ADDR (LOGO_FLASH_ADDR + LOGO_HEADER_SIZE) +#endif + #ifdef ENABLE_FEAT_F4HWN_QRCODE // QR code (version 4, 33x33 modules, EC level L) encoding: // https://github.com/armel/uv-k1-k5v3-firmware-custom @@ -216,10 +229,25 @@ void UI_DisplayWelcome(void) #endif UI_DisplayClear(); +#ifdef ENABLE_FEAT_F4HWN_LOGO + if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_LOGO) { + // Skip 8-byte header, then read 128x64 bitmap (1024 B): + // page 0 -> gStatusLine, pages 1..7 -> gFrameBuffer. + PY25Q16_ReadBuffer(LOGO_BITMAP_ADDR, gStatusLine, sizeof(gStatusLine)); + PY25Q16_ReadBuffer(LOGO_BITMAP_ADDR + sizeof(gStatusLine), gFrameBuffer, sizeof(gFrameBuffer)); + ST7565_BlitStatusLine(); + ST7565_BlitFullScreen(); + #ifdef ENABLE_FEAT_F4HWN_SCREENSHOT + SCREENSHOT_Update(true); + #endif + return; + } +#endif + #ifdef ENABLE_FEAT_F4HWN ST7565_BlitStatusLine(); ST7565_BlitFullScreen(); - + if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND) { ST7565_FillScreen(0x00); } diff --git a/CMakePresets.json b/CMakePresets.json index 444f422d..22442849 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -71,6 +71,7 @@ "ENABLE_FEAT_F4HWN_SCAN_PROGRESS": false, "ENABLE_FEAT_F4HWN_SCAN_FASTER": false, "ENABLE_FEAT_F4HWN_BEAM": false, + "ENABLE_FEAT_F4HWN_LOGO": false, "ENABLE_AGC_SHOW_DATA": false, "ENABLE_UART_RW_BK_REGS": false, "ENABLE_SWD": false, @@ -200,6 +201,7 @@ "ENABLE_FEAT_F4HWN_BEAM": true, "ENABLE_FEAT_F4HWN_QRCODE": true, "ENABLE_FEAT_F4HWN_MEM": true, + "ENABLE_FEAT_F4HWN_LOGO": true, "ENABLE_SWD": true, "EDITION_STRING": "Fusion", "TARGET": "f4hwn.fusion" diff --git a/archive/quansheng.stock.logo.png b/archive/quansheng.stock.logo.png new file mode 100644 index 00000000..fe3cc9e7 Binary files /dev/null and b/archive/quansheng.stock.logo.png differ