joystick UI: share the button-UI splash wordmark

Move the 128×13 zephcore_logo bitmap from ui-button/ui_pages.c into
the shared ui_common.c (linkage extern), with the dimensions and
declaration in display.h. Both UI splash renders now share the same
data — no duplicated array.

Joystick SplashScreen::render() now draws the wordmark at the top,
"MeshCore on Zephyr" beneath it, and the build date below — matching
the button-UI layout. Replaces the earlier text-only "MeshCore /
<version> / <date>" placeholder.
This commit is contained in:
liquidraver
2026-05-21 13:29:57 +02:00
parent fcf4e8d1cb
commit 0081e7af2b
4 changed files with 58 additions and 33 deletions
+2 -29
View File
@@ -28,35 +28,8 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(ui_pages, CONFIG_ZEPHCORE_BOARD_LOG_LEVEL);
/* ZephCore logo bitmap - 128x13px, MSB-first (Adafruit drawBitmap format) */
static const uint8_t zephcore_logo[] = {
0x00, 0x01, 0xff, 0x7f, 0xe7, 0xf8, 0x70, 0x70,
0x3c, 0x01, 0xe0, 0x7f, 0xc3, 0xff, 0x00, 0x00,
0x00, 0x01, 0xff, 0x7f, 0xe7, 0xfc, 0x70, 0x70,
0xff, 0x07, 0xf8, 0x7f, 0xe3, 0xff, 0x00, 0x00,
0x00, 0x01, 0xff, 0x7f, 0xe7, 0xfe, 0x70, 0x71,
0xff, 0x0f, 0xfc, 0x7f, 0xf3, 0xff, 0x00, 0x00,
0x00, 0x00, 0x0e, 0x70, 0x07, 0x0e, 0x70, 0x71,
0xc7, 0x8e, 0x1c, 0x70, 0x73, 0x80, 0x00, 0x00,
0x00, 0x00, 0x1c, 0x70, 0x07, 0x0e, 0x70, 0x73,
0x83, 0x1c, 0x0e, 0x70, 0x73, 0x80, 0x00, 0x00,
0x00, 0x00, 0x38, 0x7f, 0xe7, 0xfe, 0x7f, 0xf3,
0x80, 0x1c, 0x0e, 0x7f, 0xf3, 0xff, 0x00, 0x00,
0x00, 0x00, 0x78, 0x7f, 0xe7, 0xfc, 0x7f, 0xf3,
0x80, 0x1c, 0x0e, 0x7f, 0xe3, 0xff, 0x00, 0x00,
0x00, 0x00, 0x70, 0x7f, 0xe7, 0xf8, 0x7f, 0xf3,
0x80, 0x1c, 0x0e, 0x7f, 0x83, 0xff, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x70, 0x07, 0x00, 0x70, 0x73,
0x83, 0x1c, 0x0e, 0x73, 0xc3, 0x80, 0x00, 0x00,
0x00, 0x01, 0xc0, 0x70, 0x07, 0x00, 0x70, 0x71,
0xc7, 0x8e, 0x1c, 0x71, 0xe3, 0x80, 0x00, 0x00,
0x00, 0x03, 0xff, 0x7f, 0xe7, 0x00, 0x70, 0x71,
0xff, 0x0f, 0xfc, 0x70, 0xe3, 0xff, 0x00, 0x00,
0x00, 0x03, 0xff, 0x7f, 0xe7, 0x00, 0x70, 0x70,
0xff, 0x07, 0xf8, 0x70, 0xf3, 0xff, 0x00, 0x00,
0x00, 0x03, 0xff, 0x7f, 0xe7, 0x00, 0x70, 0x70,
0x3c, 0x01, 0xe0, 0x70, 0x7b, 0xff, 0x00, 0x00,
};
/* ZephCore logo bitmap is defined in helpers/ui/ui_common.c and shared with
* the joystick UI's splash. See display.h for declaration. */
/* ========== Layout ========== */
/* All layout is derived from the actual display and font dimensions
+16 -4
View File
@@ -243,11 +243,23 @@ int SplashScreen::render(JoystickDisplay &display)
_task->gotoHomeScreen();
return 0;
}
int cx = display.width() / 2;
/* Match the button-UI splash: ZephCore wordmark bitmap centered at top,
* "MeshCore on Zephyr" beneath it, build date at the bottom. Logo and
* its dimensions live in helpers/ui/ui_common.c — declared in display.h. */
int w = display.width();
int fh = display.fontH();
int line_h = fh + 2;
int logo_x = (w >= ZEPHCORE_LOGO_W) ? (w - ZEPHCORE_LOGO_W) / 2 : 0;
int y = 3;
mc_display_xbm(logo_x, y, zephcore_logo, ZEPHCORE_LOGO_W, ZEPHCORE_LOGO_H);
y += ZEPHCORE_LOGO_H + line_h;
int cx = w / 2;
display.setColor(JoystickDisplay::GREEN);
display.drawTextCentered(cx, display.height() / 4, "MeshCore");
display.drawTextCentered(cx, y + fh / 2, "MeshCore on Zephyr");
y += line_h * 2;
display.setColor(JoystickDisplay::LIGHT);
display.drawTextCentered(cx, display.height() / 2 + 4, FIRMWARE_VERSION);
display.drawTextCentered(cx, display.height() / 2 + 4 + display.fontH() + 2, FIRMWARE_BUILD_DATE);
display.drawTextCentered(cx, y + fh / 2, FIRMWARE_BUILD_DATE);
return 250;
}
+8
View File
@@ -134,6 +134,14 @@ void mc_display_invert_rect(int x, int y, int w, int h);
*/
void mc_display_xbm(int x, int y, const uint8_t *data, int w, int h);
/**
* ZephCore logo bitmap (128 × 13 px, MSB-first, row-major).
* Shared by both UI variants' splash screens. Defined in ui_common.c.
*/
#define ZEPHCORE_LOGO_W 128
#define ZEPHCORE_LOGO_H 13
extern const uint8_t zephcore_logo[];
/**
* Flush the framebuffer to the display hardware.
* Call after all drawing operations for a frame are complete.
+32
View File
@@ -233,3 +233,35 @@ void ui_invalidate_battery_cache(void)
s_batt_ever_read = false;
s_batt_last_read_ms = 0;
}
/* ========== Shared splash logo ==========
* 128×13 ZephCore wordmark, MSB-first row-major (Adafruit XBM/drawBitmap
* format). Used by both UI variants' splash renders via mc_display_xbm(). */
const uint8_t zephcore_logo[] = {
0x00, 0x01, 0xff, 0x7f, 0xe7, 0xf8, 0x70, 0x70,
0x3c, 0x01, 0xe0, 0x7f, 0xc3, 0xff, 0x00, 0x00,
0x00, 0x01, 0xff, 0x7f, 0xe7, 0xfc, 0x70, 0x70,
0xff, 0x07, 0xf8, 0x7f, 0xe3, 0xff, 0x00, 0x00,
0x00, 0x01, 0xff, 0x7f, 0xe7, 0xfe, 0x70, 0x71,
0xff, 0x0f, 0xfc, 0x7f, 0xf3, 0xff, 0x00, 0x00,
0x00, 0x00, 0x0e, 0x70, 0x07, 0x0e, 0x70, 0x71,
0xc7, 0x8e, 0x1c, 0x70, 0x73, 0x80, 0x00, 0x00,
0x00, 0x00, 0x1c, 0x70, 0x07, 0x0e, 0x70, 0x73,
0x83, 0x1c, 0x0e, 0x70, 0x73, 0x80, 0x00, 0x00,
0x00, 0x00, 0x38, 0x7f, 0xe7, 0xfe, 0x7f, 0xf3,
0x80, 0x1c, 0x0e, 0x7f, 0xf3, 0xff, 0x00, 0x00,
0x00, 0x00, 0x78, 0x7f, 0xe7, 0xfc, 0x7f, 0xf3,
0x80, 0x1c, 0x0e, 0x7f, 0xe3, 0xff, 0x00, 0x00,
0x00, 0x00, 0x70, 0x7f, 0xe7, 0xf8, 0x7f, 0xf3,
0x80, 0x1c, 0x0e, 0x7f, 0x83, 0xff, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x70, 0x07, 0x00, 0x70, 0x73,
0x83, 0x1c, 0x0e, 0x73, 0xc3, 0x80, 0x00, 0x00,
0x00, 0x01, 0xc0, 0x70, 0x07, 0x00, 0x70, 0x71,
0xc7, 0x8e, 0x1c, 0x71, 0xe3, 0x80, 0x00, 0x00,
0x00, 0x03, 0xff, 0x7f, 0xe7, 0x00, 0x70, 0x71,
0xff, 0x0f, 0xfc, 0x70, 0xe3, 0xff, 0x00, 0x00,
0x00, 0x03, 0xff, 0x7f, 0xe7, 0x00, 0x70, 0x70,
0xff, 0x07, 0xf8, 0x70, 0xf3, 0xff, 0x00, 0x00,
0x00, 0x03, 0xff, 0x7f, 0xe7, 0x00, 0x70, 0x70,
0x3c, 0x01, 0xe0, 0x70, 0x7b, 0xff, 0x00, 0x00,
};