Repository: BitBoxSwiss/bitbox02-firmware
Pull request #1464: Logo
Author: login: benma
Created: 2025-05-19T10:23:58Z | Merged: 2025-05-20T07:42:35Z



Diff:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index df2bf7d293..bdc1a62e8a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -119,6 +119,7 @@ set(DBB-BOOTLOADER-SOURCES
   ${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_9X9.c
   ${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_11X10.c
   ${CMAKE_SOURCE_DIR}/src/ui/fonts/monogram_5X9.c
+  ${CMAKE_SOURCE_DIR}/src/ui/graphics/graphics.c
   ${CMAKE_SOURCE_DIR}/src/screen.c
   ${CMAKE_SOURCE_DIR}/src/hardfault.c
   ${CMAKE_SOURCE_DIR}/src/ui/components/ui_images.c
diff --git a/src/bootloader/bootloader.c b/src/bootloader/bootloader.c
index e1e6349666..3e3b0181dd 100644
--- a/src/bootloader/bootloader.c
+++ b/src/bootloader/bootloader.c
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <ui/components/ui_images.h>
 #include <ui/fonts/arial_fonts.h>
+#include <ui/graphics/graphics.h>
 #include <ui/oled/oled.h>
 #include <ui/ugui/ugui.h>
 #include <usb/usb.h>
@@ -255,22 +256,12 @@ static void _binary_exec(void)
 
 static void _load_logo(void)
 {
-    uint16_t x = 0;
-    uint16_t y = 0;
-    for (size_t i = 0; i < sizeof(IMAGE_BB2_LOGO); i++) {
-        uint8_t b = IMAGE_BB2_LOGO[i];
-        for (uint8_t j = 0; j < 8; j++) {
-            if (b & 0x80) {
-                UG_DrawPixel(x, y, C_WHITE);
-            }
-            b <<= 1;
-            x++;
-            if ((x % IMAGE_BB2_LOGO_W) == 0) {
-                x = 0;
-                y++;
-            }
-        }
-    }
+    image_logo_data_t logo = image_logo_data();
+    const position_t pos = {
+        .left = 0,
+        .top = 0,
+    };
+    graphics_draw_image(&pos, &logo.dimensions, &logo.buffer);
 }
 
 static void _load_arrow(int x, int y, int height)
diff --git a/src/ui/components/ui_images.c b/src/ui/components/ui_images.c
index 41bc0a34e9..d70b1d089e 100644
--- a/src/ui/components/ui_images.c
+++ b/src/ui/components/ui_images.c
@@ -14,8 +14,11 @@
 
 #include "ui_images.h"
 
+#include <memory/memory_shared.h>
 #include <platform/platform_config.h>
+#include <ui/graphics/graphics.h>
 #include <ui/ugui/ugui.h>
+#include <util.h>
 
 void image_arrow(int x, int y, int height, arrow_orientation_t orientation)
 {
@@ -122,3 +125,192 @@ void image_sdcard(bool mirror)
     UG_DrawLine(
         x - m * (w - c - 1), y - m * h / 2, x - m * (w - 1), y - m * h / 2 + m * c, C_WHITE);
 }
+
+// Logo images:
+// In the bootloader we hardcode by target. We currently have one firmware for both BB02 and
+// BB02-Plus, so we include both in the firmware.
+
+#if (PRODUCT_BITBOX_BTCONLY == 1) || (PRODUCT_BITBOX_PLUS_BTCONLY == 1)
+
+#if !defined(BOOTLOADER) || (PRODUCT_BITBOX_BTCONLY == 1)
+#define IMAGE_BITBOX02_LOGO_W 79
+#define IMAGE_BITBOX02_LOGO_H 25
+const uint8_t IMAGE_BITBOX02_LOGO[] = {
+    0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x18, 0x60, 0xff, 0x00, 0x00,
+    0x00, 0x07, 0x80, 0xf3, 0x06, 0x00, 0xc1, 0x83, 0x00, 0x00, 0x00, 0x10, 0x82, 0x16, 0x0c, 0x67,
+    0xe3, 0x06, 0x0f, 0x87, 0x1c, 0x21, 0x08, 0x1c, 0x18, 0xcf, 0xc6, 0x0c, 0x3f, 0x86, 0x30, 0x81,
+    0x00, 0x3f, 0xe1, 0x86, 0x0f, 0xf0, 0x63, 0x06, 0xc1, 0x02, 0x00, 0x7f, 0xc3, 0x0c, 0x1f, 0xe1,
+    0x83, 0x0f, 0x82, 0x04, 0x01, 0x60, 0xc6, 0x18, 0x30, 0x63, 0x06, 0x0e, 0x04, 0x08, 0x0c, 0xc1,
+    0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x10, 0x61, 0x83, 0x18, 0x60, 0xc1, 0x8c, 0x18, 0x7c,
+    0x10, 0x21, 0x03, 0x06, 0x30, 0xc1, 0x83, 0x0c, 0x60, 0xd8, 0x10, 0x84, 0x07, 0xf8, 0x61, 0xe3,
+    0xfc, 0x1f, 0xc3, 0x18, 0x21, 0x08, 0x0f, 0xe0, 0xc1, 0xc7, 0xf0, 0x1f, 0x0e, 0x38, 0x3c, 0x1f,
+    0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x00,
+    0x04, 0x00, 0x00, 0x20, 0x00, 0x0a, 0x08, 0x01, 0x21, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10,
+    0x80, 0x02, 0x57, 0x31, 0x97, 0x01, 0x9c, 0xa2, 0x18, 0xeb, 0xa6, 0x77, 0xa4, 0x94, 0xa9, 0x04,
+    0xa5, 0x44, 0x4a, 0x52, 0x52, 0x99, 0x49, 0x09, 0x52, 0xe9, 0x4a, 0x50, 0xf4, 0xa4, 0xa5, 0x32,
+    0x92, 0x52, 0xa4, 0x12, 0x94, 0xa1, 0x09, 0x49, 0x4a, 0x79, 0x23, 0x19, 0x48, 0x19, 0x28, 0x81,
+    0xce, 0x92, 0x64, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00};
+#endif
+
+#if !defined(BOOTLOADER) || (PRODUCT_BITBOX_PLUS_BTCONLY == 1)
+#define IMAGE_BITBOX02_PLUS_LOGO_W 107
+#define IMAGE_BITBOX02_PLUS_LOGO_H 25
+static const uint8_t IMAGE_BITBOX02_PLUS_LOGO[] = {
+    0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x1f, 0xe1, 0x86,
+    0x0f, 0xf0, 0x00, 0x00, 0x00, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x03, 0x06, 0x00, 0xc1, 0x83, 0x00,
+    0x00, 0x00, 0x01, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x60, 0xc6, 0x7e, 0x30, 0x60, 0xf8, 0x71, 0xc0,
+    0x3c, 0x18, 0x7c, 0x60, 0xc7, 0xcc, 0x18, 0xcf, 0xc6, 0x0c, 0x3f, 0x86, 0x30, 0x06, 0xc3, 0x1f,
+    0xcc, 0x1b, 0xfd, 0xfe, 0x18, 0x60, 0xff, 0x06, 0x30, 0x6c, 0x00, 0xcc, 0x67, 0x1c, 0xc6, 0x61,
+    0xbf, 0xc3, 0x0c, 0x1f, 0xe1, 0x83, 0x0f, 0x80, 0x18, 0x8c, 0xc1, 0x98, 0xc0, 0xf6, 0x0c, 0x61,
+    0x83, 0x06, 0x30, 0x60, 0xe0, 0x03, 0x19, 0x98, 0x33, 0x18, 0xfe, 0xc1, 0x8c, 0x30, 0x60, 0xc6,
+    0x0c, 0x1c, 0x00, 0x61, 0xb3, 0x06, 0x36, 0x3c, 0xd8, 0x31, 0x86, 0x0c, 0x18, 0xc1, 0x87, 0xc0,
+    0x0c, 0x1e, 0x60, 0xc6, 0xc6, 0x1b, 0x06, 0x30, 0xc1, 0x83, 0x0c, 0x60, 0xd8, 0x01, 0x83, 0xce,
+    0x38, 0x70, 0xc7, 0x7f, 0x86, 0x1e, 0x3f, 0xc1, 0xfc, 0x31, 0x80, 0x30, 0x38, 0xfe, 0x0e, 0x1f,
+    0xef, 0xe0, 0xc1, 0xc7, 0xf0, 0x1f, 0x0e, 0x38, 0x06, 0x03, 0x0f, 0x81, 0xc1, 0xe6, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x0a, 0x08, 0x00,
+    0x00, 0x00, 0x00, 0x12, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00,
+    0x02, 0x57, 0x31, 0x97, 0x01, 0x9c, 0xa2, 0x18, 0xeb, 0xa6, 0x70, 0x00, 0x00, 0x00, 0x7a, 0x49,
+    0x4a, 0x90, 0x4a, 0x54, 0x44, 0xa5, 0x25, 0x29, 0x00, 0x00, 0x00, 0x09, 0x49, 0x09, 0x52, 0xe9,
+    0x4a, 0x50, 0xf4, 0xa4, 0xa5, 0x20, 0x00, 0x00, 0x01, 0x29, 0x25, 0x2a, 0x41, 0x29, 0x4a, 0x10,
+    0x94, 0x94, 0xa4, 0x00, 0x00, 0x00, 0x39, 0x23, 0x19, 0x48, 0x19, 0x28, 0x81, 0xce, 0x92, 0x64,
+    0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+#endif
+
+#elif (PRODUCT_BITBOX_MULTI == 1) || (PRODUCT_BITBOX_PLUS_MULTI == 1) || \
+    PRODUCT_BITBOX02_FACTORYSETUP == 1
+
+#if !defined(BOOTLOADER) || (PRODUCT_BITBOX_MULTI == 1)
+#define IMAGE_BITBOX02_LOGO_W 79
+#define IMAGE_BITBOX02_LOGO_H 23
+static const uint8_t IMAGE_BITBOX02_LOGO[] = {
+    0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x18, 0x60, 0xff, 0x00, 0x00,
+    0x00, 0x07, 0x80, 0xf3, 0x06, 0x00, 0xc1, 0x83, 0x00, 0x00, 0x00, 0x10, 0x82, 0x16, 0x0c, 0x67,
+    0xe3, 0x06, 0x0f, 0x87, 0x1c, 0x21, 0x08, 0x1c, 0x18, 0xcf, 0xc6, 0x0c, 0x3f, 0x86, 0x30, 0x81,
+    0x00, 0x3f, 0xe1, 0x86, 0x0f, 0xf0, 0x63, 0x06, 0xc1, 0x02, 0x00, 0x7f, 0xc3, 0x0c, 0x1f, 0xe1,
+    0x83, 0x0f, 0x82, 0x04, 0x01, 0x60, 0xc6, 0x18, 0x30, 0x63, 0x06, 0x0e, 0x04, 0x08, 0x0c, 0xc1,
+    0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x10, 0x61, 0x83, 0x18, 0x60, 0xc1, 0x8c, 0x18, 0x7c,
+    0x10, 0x21, 0x03, 0x06, 0x30, 0xc1, 0x83, 0x0c, 0x60, 0xd8, 0x10, 0x84, 0x07, 0xf8, 0x61, 0xe3,
+    0xfc, 0x1f, 0xc3, 0x18, 0x21, 0x08, 0x0f, 0xe0, 0xc1, 0xc7, 0xf0, 0x1f, 0x0e, 0x38, 0x3c, 0x1f,
+    0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x04,
+    0x10, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x01, 0x8c, 0x09, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
+    0x00, 0x02, 0xaa, 0x57, 0x41, 0x8e, 0xba, 0x67, 0x00, 0x00, 0x00, 0x05, 0x54, 0xa4, 0x84, 0xa5,
+    0x25, 0x29, 0x00, 0x00, 0x00, 0x09, 0x29, 0x49, 0x0f, 0x4a, 0x4a, 0x52, 0x00, 0x00, 0x00, 0x12,
+    0x52, 0x92, 0x10, 0x94, 0x94, 0xa4, 0x00, 0x00, 0x00, 0x20, 0x99, 0x24, 0x1c, 0xe9, 0x26, 0x48,
+    0x00, 0x00, 0x00, 0x00};
+#endif
+
+#if !defined(BOOTLOADER) || (PRODUCT_BITBOX_PLUS_MULTI == 1)
+#define IMAGE_BITBOX02_PLUS_LOGO_W 107
+#define IMAGE_BITBOX02_PLUS_LOGO_H 23
+static const uint8_t IMAGE_BITBOX02_PLUS_LOGO[] = {
+    0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x1f, 0xe1, 0x86,
+    0x0f, 0xf0, 0x00, 0x00, 0x00, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x03, 0x06, 0x00, 0xc1, 0x83, 0x00,
+    0x00, 0x00, 0x01, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x60, 0xc6, 0x7e, 0x30, 0x60, 0xf8, 0x71, 0xc0,
+    0x3c, 0x18, 0x7c, 0x60, 0xc7, 0xcc, 0x18, 0xcf, 0xc6, 0x0c, 0x3f, 0x86, 0x30, 0x06, 0xc3, 0x1f,
+    0xcc, 0x1b, 0xfd, 0xfe, 0x18, 0x60, 0xff, 0x06, 0x30, 0x6c, 0x00, 0xcc, 0x67, 0x1c, 0xc6, 0x61,
+    0xbf, 0xc3, 0x0c, 0x1f, 0xe1, 0x83, 0x0f, 0x80, 0x18, 0x8c, 0xc1, 0x98, 0xc0, 0xf6, 0x0c, 0x61,
+    0x83, 0x06, 0x30, 0x60, 0xe0, 0x03, 0x19, 0x98, 0x33, 0x18, 0xfe, 0xc1, 0x8c, 0x30, 0x60, 0xc6,
+    0x0c, 0x1c, 0x00, 0x61, 0xb3, 0x06, 0x36, 0x3c, 0xd8, 0x31, 0x86, 0x0c, 0x18, 0xc1, 0x87, 0xc0,
+    0x0c, 0x1e, 0x60, 0xc6, 0xc6, 0x1b, 0x06, 0x30, 0xc1, 0x83, 0x0c, 0x60, 0xd8, 0x01, 0x83, 0xce,
+    0x38, 0x70, 0xc7, 0x7f, 0x86, 0x1e, 0x3f, 0xc1, 0xfc, 0x31, 0x80, 0x30, 0x38, 0xfe, 0x0e, 0x1f,
+    0xef, 0xe0, 0xc1, 0xc7, 0xf0, 0x1f, 0x0e, 0x38, 0x06, 0x03, 0x0f, 0x81, 0xc1, 0xe6, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x04, 0x10, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x18, 0xc0, 0x90, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x02, 0xaa, 0x57, 0x41, 0x8e, 0xba, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x4a,
+    0x48, 0x4a, 0x52, 0x52, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x29, 0x49, 0x0f, 0x4a,
+    0x4a, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x25, 0x29, 0x21, 0x09, 0x49, 0x4a, 0x40,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x99, 0x24, 0x1c, 0xe9, 0x26, 0x48, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00,
+};
+#endif
+
+#else
+
+#error "Invalid product"
+
+#endif
+
+#if defined(BOOTLOADER)
+// image logo for bootloader.
+image_logo_data_t image_logo_data(void)
+{
+#if (PRODUCT_BITBOX_BTCONLY == 1) || (PRODUCT_BITBOX_MULTI == 1) || \
+    (PRODUCT_BITBOX02_FACTORYSETUP == 1)
+    image_logo_data_t result = {
+        .buffer =
+            {
+                .data = IMAGE_BITBOX02_LOGO,
+                .len = sizeof(IMAGE_BITBOX02_LOGO),
+            },
+        .dimensions =
+            {
+                .width = IMAGE_BITBOX02_LOGO_W,
+                .height = IMAGE_BITBOX02_LOGO_H,
+            },
+    };
+    return result;
+#elif (PRODUCT_BITBOX_PLUS_BTCONLY == 1) || (PRODUCT_BITBOX_PLUS_MULTI == 1)
+    image_logo_data_t result = {
+        .buffer =
+            {
+                .data = IMAGE_BITBOX02_PLUS_LOGO,
+                .len = sizeof(IMAGE_BITBOX02_PLUS_LOGO),
+            },
+        .dimensions =
+            {
+                .width = IMAGE_BITBOX02_PLUS_LOGO_W,
+                .height = IMAGE_BITBOX02_PLUS_LOGO_H,
+            },
+    };
+    return result;
+#else
+#error "unknown platform"
+#endif
+}
+#else
+// image logo for firmware.
+image_logo_data_t image_logo_data(void)
+{
+    switch (memory_get_platform()) {
+    case MEMORY_PLATFORM_BITBOX02_PLUS: {
+        image_logo_data_t result = {
+            .buffer =
+                {
+                    .data = IMAGE_BITBOX02_PLUS_LOGO,
+                    .len = sizeof(IMAGE_BITBOX02_PLUS_LOGO),
+                },
+            .dimensions =
+                {
+                    .width = IMAGE_BITBOX02_PLUS_LOGO_W,
+                    .height = IMAGE_BITBOX02_PLUS_LOGO_H,
+                },
+        };
+        return result;
+    }
+    default: {
+        image_logo_data_t result = {
+            .buffer =
+                {
+                    .data = IMAGE_BITBOX02_LOGO,
+                    .len = sizeof(IMAGE_BITBOX02_LOGO),
+                },
+            .dimensions =
+                {
+                    .width = IMAGE_BITBOX02_LOGO_W,
+                    .height = IMAGE_BITBOX02_LOGO_H,
+                },
+        };
+        return result;
+    }
+    }
+}
+#endif
diff --git a/src/ui/components/ui_images.h b/src/ui/components/ui_images.h
index dc0f95db52..a3758120ee 100644
--- a/src/ui/components/ui_images.h
+++ b/src/ui/components/ui_images.h
@@ -18,61 +18,10 @@
 #include <platform/platform_config.h>
 
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdint.h>
 
-// TODO: Make new logos for plus!
-
-#if (PRODUCT_BITBOX_BTCONLY == 1) || (PRODUCT_BITBOX_PLUS_BTCONLY == 1)
-
-#define IMAGE_BB2_LOGO_W 79
-#define IMAGE_BB2_LOGO_H 25
-
-static const uint8_t IMAGE_BB2_LOGO[] = {
-    0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x18, 0x60, 0xff, 0x00, 0x00,
-    0x00, 0x07, 0x80, 0xf3, 0x06, 0x00, 0xc1, 0x83, 0x00, 0x00, 0x00, 0x10, 0x82, 0x16, 0x0c, 0x67,
-    0xe3, 0x06, 0x0f, 0x87, 0x1c, 0x21, 0x08, 0x1c, 0x18, 0xcf, 0xc6, 0x0c, 0x3f, 0x86, 0x30, 0x81,
-    0x00, 0x3f, 0xe1, 0x86, 0x0f, 0xf0, 0x63, 0x06, 0xc1, 0x02, 0x00, 0x7f, 0xc3, 0x0c, 0x1f, 0xe1,
-    0x83, 0x0f, 0x82, 0x04, 0x01, 0x60, 0xc6, 0x18, 0x30, 0x63, 0x06, 0x0e, 0x04, 0x08, 0x0c, 0xc1,
-    0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x10, 0x61, 0x83, 0x18, 0x60, 0xc1, 0x8c, 0x18, 0x7c,
-    0x10, 0x21, 0x03, 0x06, 0x30, 0xc1, 0x83, 0x0c, 0x60, 0xd8, 0x10, 0x84, 0x07, 0xf8, 0x61, 0xe3,
-    0xfc, 0x1f, 0xc3, 0x18, 0x21, 0x08, 0x0f, 0xe0, 0xc1, 0xc7, 0xf0, 0x1f, 0x0e, 0x38, 0x3c, 0x1f,
-    0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x00,
-    0x04, 0x00, 0x00, 0x20, 0x00, 0x0a, 0x08, 0x01, 0x21, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10,
-    0x80, 0x02, 0x57, 0x31, 0x97, 0x01, 0x9c, 0xa2, 0x18, 0xeb, 0xa6, 0x77, 0xa4, 0x94, 0xa9, 0x04,
-    0xa5, 0x44, 0x4a, 0x52, 0x52, 0x99, 0x49, 0x09, 0x52, 0xe9, 0x4a, 0x50, 0xf4, 0xa4, 0xa5, 0x32,
-    0x92, 0x52, 0xa4, 0x12, 0x94, 0xa1, 0x09, 0x49, 0x4a, 0x79, 0x23, 0x19, 0x48, 0x19, 0x28, 0x81,
-    0xce, 0x92, 0x64, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00};
-
-#elif (PRODUCT_BITBOX_MULTI == 1) || (PRODUCT_BITBOX_PLUS_MULTI == 1) || \
-    PRODUCT_BITBOX02_FACTORYSETUP == 1
-
-#define IMAGE_BB2_LOGO_W 79
-#define IMAGE_BB2_LOGO_H 23
-
-static const uint8_t IMAGE_BB2_LOGO[] = {
-    0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x18, 0x60, 0xff, 0x00, 0x00,
-    0x00, 0x07, 0x80, 0xf3, 0x06, 0x00, 0xc1, 0x83, 0x00, 0x00, 0x00, 0x10, 0x82, 0x16, 0x0c, 0x67,
-    0xe3, 0x06, 0x0f, 0x87, 0x1c, 0x21, 0x08, 0x1c, 0x18, 0xcf, 0xc6, 0x0c, 0x3f, 0x86, 0x30, 0x81,
-    0x00, 0x3f, 0xe1, 0x86, 0x0f, 0xf0, 0x63, 0x06, 0xc1, 0x02, 0x00, 0x7f, 0xc3, 0x0c, 0x1f, 0xe1,
-    0x83, 0x0f, 0x82, 0x04, 0x01, 0x60, 0xc6, 0x18, 0x30, 0x63, 0x06, 0x0e, 0x04, 0x08, 0x0c, 0xc1,
-    0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x10, 0x61, 0x83, 0x18, 0x60, 0xc1, 0x8c, 0x18, 0x7c,
-    0x10, 0x21, 0x03, 0x06, 0x30, 0xc1, 0x83, 0x0c, 0x60, 0xd8, 0x10, 0x84, 0x07, 0xf8, 0x61, 0xe3,
-    0xfc, 0x1f, 0xc3, 0x18, 0x21, 0x08, 0x0f, 0xe0, 0xc1, 0xc7, 0xf0, 0x1f, 0x0e, 0x38, 0x3c, 0x1f,
-    0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x04,
-    0x10, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x01, 0x8c, 0x09, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
-    0x00, 0x02, 0xaa, 0x57, 0x41, 0x8e, 0xba, 0x67, 0x00, 0x00, 0x00, 0x05, 0x54, 0xa4, 0x84, 0xa5,
-    0x25, 0x29, 0x00, 0x00, 0x00, 0x09, 0x29, 0x49, 0x0f, 0x4a, 0x4a, 0x52, 0x00, 0x00, 0x00, 0x12,
-    0x52, 0x92, 0x10, 0x94, 0x94, 0xa4, 0x00, 0x00, 0x00, 0x20, 0x99, 0x24, 0x1c, 0xe9, 0x26, 0x48,
-    0x00, 0x00, 0x00, 0x00};
-
-#else
-
-#error "Invalid product"
-
-#endif
+#include <ui/graphics/graphics.h>
 
 #define IMAGE_ROTATE_W 22
 #define IMAGE_ROTATE_H 14
@@ -107,6 +56,13 @@ void image_lock(int x, int y, int r);
 void image_unlock(int x, int y, int r);
 void image_sdcard(bool mirror);
 
+typedef struct {
+    in_buffer_t buffer;
+    size_t data_len;
+    dimension_t dimensions;
+} image_logo_data_t;
+image_logo_data_t image_logo_data(void);
+
 #define IMAGE_SCREENSAVER_W 17
 #define IMAGE_SCREENSAVER_H 20
 
diff --git a/src/ui/components/waiting.c b/src/ui/components/waiting.c
index 60cc9422ac..d284f4d8ee 100644
--- a/src/ui/components/waiting.c
+++ b/src/ui/components/waiting.c
@@ -57,11 +57,12 @@ component_t* waiting_create(void)
     waiting->dimension.height = SCREEN_HEIGHT;
     waiting->position.top = 0;
     waiting->position.left = 0;
+    image_logo_data_t logo = image_logo_data();
     component_t* bb2_logo = image_create(
-        IMAGE_BB2_LOGO,
-        sizeof(IMAGE_BB2_LOGO),
-        IMAGE_BB2_LOGO_W,
-        IMAGE_BB2_LOGO_H,
+        logo.buffer.data,
+        logo.buffer.len,
+        logo.dimensions.width,
+        logo.dimensions.height,
         CENTER,
         waiting);
     ui_util_add_sub_component(waiting, bb2_logo);


Reviews:
user: login: NickeZ
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-19T10:28:09Z
user: login: NickeZ
body: utACK
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-19T10:29:42Z
user: login: benma
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-19T10:55:59Z
user: login: NickeZ
body: Why did you go with two function names when they are "mutually exclusive" so both could have the same name?
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-19T12:39:01Z
user: login: benma
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-19T12:50:50Z
user: login: NickeZ
body: utack
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-20T07:28:23Z

Review comments:
diff_hunk: @@ -122,3 +125,142 @@ void image_sdcard(bool mirror)
     UG_DrawLine(
         x - m * (w - c - 1), y - m * h / 2, x - m * (w - 1), y - m * h / 2 + m * c, C_WHITE);
 }
+
+// TODO: Make new logos for plus!
path: src/ui/components/ui_images.c
user: login: NickeZ
body: can't you remove this TODO?
created_at: 2025-05-19T10:28:09Z
author_association: COLLABORATOR
diff_hunk: @@ -122,3 +125,142 @@ void image_sdcard(bool mirror)
     UG_DrawLine(
         x - m * (w - c - 1), y - m * h / 2, x - m * (w - 1), y - m * h / 2 + m * c, C_WHITE);
 }
+
+// TODO: Make new logos for plus!
path: src/ui/components/ui_images.c
user: login: benma
body: i can :smile: and did now
created_at: 2025-05-19T10:55:59Z
author_association: COLLABORATOR
diff_hunk: @@ -220,14 +231,54 @@ static const uint8_t IMAGE_BITBOX02_PLUS_LOGO[] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x99, 0x24, 0x1c, 0xe9, 0x26, 0x48, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00,
 };
+#endif
 
 #else
 
 #error "Invalid product"
 
 #endif
 
-image_logo_data_t image_logo_data(void)
+#if defined(BOOTLOADER)
+image_logo_data_t image_logo_data_bl(void)
+{
+#if (PRODUCT_BITBOX_BTCONLY == 1) || (PRODUCT_BITBOX_MULTI == 1) || \
+    (PRODUCT_BITBOX02_FACTORYSETUP == 1)
+    image_logo_data_t result = {
+        .buffer =
+            {
+                .data = IMAGE_BITBOX02_LOGO,
+                .len = sizeof(IMAGE_BITBOX02_LOGO),
+            },
+        .dimensions =
+            {
+                .width = IMAGE_BITBOX02_LOGO_W,
+                .height = IMAGE_BITBOX02_LOGO_H,
+            },
+    };
+    return result;
+#elif (PRODUCT_BITBOX_PLUS_BTCONLY == 1) || (PRODUCT_BITBOX_PLUS_MULTI == 1)
+    image_logo_data_t result = {
+        .buffer =
+            {
+                .data = IMAGE_BITBOX02_PLUS_LOGO,
+                .len = sizeof(IMAGE_BITBOX02_PLUS_LOGO),
+            },
+        .dimensions =
+            {
+                .width = IMAGE_BITBOX02_PLUS_LOGO_W,
+                .height = IMAGE_BITBOX02_PLUS_LOGO_H,
+            },
+    };
+    return result;
+#else
+#error "unknown platform"
+#endif
+}
+#endif // defined(BOOTLOADER)
+
+#if !defined(BOOTLOADER)
path: src/ui/components/ui_images.c
user: login: NickeZ
body: why not just `#else` here?
created_at: 2025-05-19T12:38:25Z
author_association: COLLABORATOR
diff_hunk: @@ -220,14 +231,54 @@ static const uint8_t IMAGE_BITBOX02_PLUS_LOGO[] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x99, 0x24, 0x1c, 0xe9, 0x26, 0x48, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00,
 };
+#endif
 
 #else
 
 #error "Invalid product"
 
 #endif
 
-image_logo_data_t image_logo_data(void)
+#if defined(BOOTLOADER)
+image_logo_data_t image_logo_data_bl(void)
+{
+#if (PRODUCT_BITBOX_BTCONLY == 1) || (PRODUCT_BITBOX_MULTI == 1) || \
+    (PRODUCT_BITBOX02_FACTORYSETUP == 1)
+    image_logo_data_t result = {
+        .buffer =
+            {
+                .data = IMAGE_BITBOX02_LOGO,
+                .len = sizeof(IMAGE_BITBOX02_LOGO),
+            },
+        .dimensions =
+            {
+                .width = IMAGE_BITBOX02_LOGO_W,
+                .height = IMAGE_BITBOX02_LOGO_H,
+            },
+    };
+    return result;
+#elif (PRODUCT_BITBOX_PLUS_BTCONLY == 1) || (PRODUCT_BITBOX_PLUS_MULTI == 1)
+    image_logo_data_t result = {
+        .buffer =
+            {
+                .data = IMAGE_BITBOX02_PLUS_LOGO,
+                .len = sizeof(IMAGE_BITBOX02_PLUS_LOGO),
+            },
+        .dimensions =
+            {
+                .width = IMAGE_BITBOX02_PLUS_LOGO_W,
+                .height = IMAGE_BITBOX02_PLUS_LOGO_H,
+            },
+    };
+    return result;
+#else
+#error "unknown platform"
+#endif
+}
+#endif // defined(BOOTLOADER)
+
+#if !defined(BOOTLOADER)
path: src/ui/components/ui_images.c
user: login: benma
body: No reason - changed to `#else`
created_at: 2025-05-19T12:50:50Z
author_association: COLLABORATOR

PR comments:
user: login: benma
created_at: 2025-05-19T12:48:42Z
body: > Why did you go with two function names when they are "mutually exclusive" so both could have the same name?

Just for code clarity - I thought two functions with clear purposes are easier to read and understand than a monster function with a ton of `#if/#else` inside the function body.
author_association: COLLABORATOR
user: login: NickeZ
created_at: 2025-05-19T13:48:31Z
body: > > Why did you go with two function names when they are "mutually exclusive" so both could have the same name?
> 
> Just for code clarity - I thought two functions with clear purposes are easier to read and understand than a monster function with a ton of `#if/#else` inside the function body.

But only one of them are instantiated, so they could have the same name?
author_association: COLLABORATOR
user: login: benma
created_at: 2025-05-19T14:43:55Z
body: > But only one of them are instantiated, so they could have the same name?

Yeah, I still thought it's clearer. Changed it now to be the same name.
author_association: COLLABORATOR