Skip to content

Commit

Permalink
cmake: Separate the platform-independent UI components.
Browse files Browse the repository at this point in the history
Most of the workflow, components, and UI code doesn't depend
on the platform it will be run on. Compile it only once to save
many CMake build entries.
  • Loading branch information
conte91 committed Dec 3, 2019
1 parent 3340f34 commit 58fe31e
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 116 deletions.
121 changes: 73 additions & 48 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,12 @@ set(DBB-FIRMWARE-COMMON-SOURCES
${CMAKE_SOURCE_DIR}/src/restore.c
${CMAKE_SOURCE_DIR}/src/reset.c
${CMAKE_SOURCE_DIR}/src/cipher/cipher.c
${CMAKE_SOURCE_DIR}/src/workflow/blocking.c
${CMAKE_SOURCE_DIR}/src/workflow/cancel.c
${CMAKE_SOURCE_DIR}/src/workflow/workflow.c
${CMAKE_SOURCE_DIR}/src/workflow/trinary_input.c
${CMAKE_SOURCE_DIR}/src/workflow/confirm.c
${CMAKE_SOURCE_DIR}/src/workflow/confirm_time.c
${CMAKE_SOURCE_DIR}/src/workflow/status.c
${CMAKE_SOURCE_DIR}/src/workflow/password.c
${CMAKE_SOURCE_DIR}/src/workflow/password_enter.c
${CMAKE_SOURCE_DIR}/src/workflow/create_seed.c
${CMAKE_SOURCE_DIR}/src/workflow/unlock.c
${CMAKE_SOURCE_DIR}/src/workflow/show_mnemonic.c
${CMAKE_SOURCE_DIR}/src/workflow/restore_from_mnemonic.c
${CMAKE_SOURCE_DIR}/src/workflow/pairing.c
${CMAKE_SOURCE_DIR}/src/workflow/verify_pub.c
${CMAKE_SOURCE_DIR}/src/workflow/verify_recipient.c
${CMAKE_SOURCE_DIR}/src/workflow/verify_total.c
${CMAKE_SOURCE_DIR}/src/workflow/reboot.c
${CMAKE_SOURCE_DIR}/src/workflow/sdcard.c
${CMAKE_SOURCE_DIR}/src/workflow/backup.c
${CMAKE_SOURCE_DIR}/src/workflow/reset.c
${CMAKE_SOURCE_DIR}/src/workflow/restore.c
${CMAKE_SOURCE_DIR}/src/queue.c
${CMAKE_SOURCE_DIR}/src/usb/usb_processing.c
${CMAKE_SOURCE_DIR}/src/workflow/reboot.c
${CMAKE_SOURCE_DIR}/src/workflow/restore.c
${CMAKE_SOURCE_DIR}/src/workflow/restore_from_mnemonic.c
${CMAKE_SOURCE_DIR}/src/workflow/workflow.c
)
set(DBB-FIRMWARE-COMMON-SOURCES ${DBB-FIRMWARE-COMMON-SOURCES} PARENT_SCOPE)

Expand All @@ -69,23 +51,33 @@ set(DBB-FIRMWARE-USART-SOURCES
)
set(DBB-FIRMWARE-USART-SOURCES ${DBB-FIRMWARE-USART-SOURCES} PARENT_SCOPE)

set(DBB-FIRMWARE-UI-SOURCES
${CMAKE_SOURCE_DIR}/src/screen.c
${CMAKE_SOURCE_DIR}/src/ui/ugui/ugui.c
set(DBB-FIRMWARE-UI-COMMON-SOURCES
${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_9X9.c
${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_11X12.c
${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_13X14.c
${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_15X16.c
${CMAKE_SOURCE_DIR}/src/ui/fonts/font_a_17X18.c
${CMAKE_SOURCE_DIR}/src/ui/screen_stack.c
${CMAKE_SOURCE_DIR}/src/ui/screen_process.c
${CMAKE_SOURCE_DIR}/src/ui/event_handler.c
${CMAKE_SOURCE_DIR}/src/ui/ui_util.c
)
set(DBB-FIRMWARE-UI-COMMON-SOURCES ${DBB-FIRMWARE-UI-COMMON-SOURCES} PARENT_SCOPE)

# UI items that are tied to their platform.
set(DBB-FIRMWARE-UI-SOURCES
${CMAKE_SOURCE_DIR}/src/screen.c
${CMAKE_SOURCE_DIR}/src/ui/components/show_logo.c
${CMAKE_SOURCE_DIR}/src/ui/components/waiting.c
${CMAKE_SOURCE_DIR}/src/ui/screen_process.c
${CMAKE_SOURCE_DIR}/src/ui/ugui/ugui.c
)
set(DBB-FIRMWARE-UI-SOURCES ${DBB-FIRMWARE-UI-SOURCES} PARENT_SCOPE)

# Component files that are not tied to a particular platform.
set(DBB-FIRMWARE-COMPONENT-SOURCES
${CMAKE_SOURCE_DIR}/src/ui/components/trinary_choice.c
${CMAKE_SOURCE_DIR}/src/ui/components/trinary_input_char.c
${CMAKE_SOURCE_DIR}/src/ui/components/trinary_input_string.c
${CMAKE_SOURCE_DIR}/src/ui/components/show_logo.c
${CMAKE_SOURCE_DIR}/src/ui/components/waiting.c
${CMAKE_SOURCE_DIR}/src/ui/components/entry_screen.c
${CMAKE_SOURCE_DIR}/src/ui/components/knight_rider.c
${CMAKE_SOURCE_DIR}/src/ui/components/right_arrow.c
Expand All @@ -108,7 +100,30 @@ set(DBB-FIRMWARE-UI-SOURCES
${CMAKE_SOURCE_DIR}/src/ui/components/ui_images.c
${CMAKE_SOURCE_DIR}/src/ui/components/confirm_transaction.c
)
set(DBB-FIRMWARE-UI-SOURCES ${DBB-FIRMWARE-UI-SOURCES} PARENT_SCOPE)
set(DBB-FIRMWARE-COMPONENT-SOURCES ${DBB-FIRMWARE-COMPONENT-SOURCES} PARENT_SCOPE)

# All workflows that don't depend on a particular platform.
set(DBB-FIRMWARE-WORKFLOW-SOURCES
${CMAKE_SOURCE_DIR}/src/workflow/blocking.c
${CMAKE_SOURCE_DIR}/src/workflow/cancel.c
${CMAKE_SOURCE_DIR}/src/workflow/trinary_input.c
${CMAKE_SOURCE_DIR}/src/workflow/confirm.c
${CMAKE_SOURCE_DIR}/src/workflow/confirm_time.c
${CMAKE_SOURCE_DIR}/src/workflow/status.c
${CMAKE_SOURCE_DIR}/src/workflow/password.c
${CMAKE_SOURCE_DIR}/src/workflow/password_enter.c
${CMAKE_SOURCE_DIR}/src/workflow/create_seed.c
${CMAKE_SOURCE_DIR}/src/workflow/unlock.c
${CMAKE_SOURCE_DIR}/src/workflow/show_mnemonic.c
${CMAKE_SOURCE_DIR}/src/workflow/pairing.c
${CMAKE_SOURCE_DIR}/src/workflow/verify_pub.c
${CMAKE_SOURCE_DIR}/src/workflow/verify_recipient.c
${CMAKE_SOURCE_DIR}/src/workflow/verify_total.c
${CMAKE_SOURCE_DIR}/src/workflow/sdcard.c
${CMAKE_SOURCE_DIR}/src/workflow/backup.c
${CMAKE_SOURCE_DIR}/src/workflow/reset.c
)
set(DBB-FIRMWARE-WORKFLOW-SOURCES ${DBB-FIRMWARE-WORKFLOW-SOURCES} PARENT_SCOPE)

set(DBB-BOOTLOADER-SOURCES
${CMAKE_SOURCE_DIR}/src/pukcc/curve_p256.c
Expand Down Expand Up @@ -257,23 +272,6 @@ target_include_directories(util SYSTEM PUBLIC ${SYSTEMINCLUDES})
target_include_directories(util SYSTEM PUBLIC ${NANOPB_INCLUDE_DIRS})
target_include_directories(util SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/src)

add_library(app_btc-btc ${APP-BTC-SOURCES})
target_compile_definitions(app_btc-btc PUBLIC "APP_BTC=1" "APP_LTC=0")
target_include_directories(app_btc-btc PRIVATE ${INCLUDES})
target_include_directories(app_btc-btc SYSTEM PUBLIC ${SYSTEMINCLUDES})
target_include_directories(app_btc-btc SYSTEM PUBLIC ${NANOPB_INCLUDE_DIRS})
target_include_directories(app_btc-btc SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/src)
target_link_libraries(app_btc-btc noiseprotocol wallycore secp256k1 util)

add_library(app_btc-multi ${APP-BTC-SOURCES})
target_compile_definitions(app_btc-multi PUBLIC "APP_BTC=1" "APP_LTC=1")
target_compile_definitions(app_btc-multi PRIVATE "NO_PLATFORM_CONFIGURED")
target_include_directories(app_btc-multi PRIVATE ${INCLUDES})
target_include_directories(app_btc-multi SYSTEM PUBLIC ${SYSTEMINCLUDES})
target_include_directories(app_btc-multi SYSTEM PUBLIC ${NANOPB_INCLUDE_DIRS})
target_include_directories(app_btc-multi SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/src)
target_link_libraries(app_btc-multi noiseprotocol wallycore secp256k1 util)

set(FIRMWARE-SOURCES
${DBB-FIRMWARE-UI-SOURCES}
${FIRMWARE-DRIVER-SOURCES}
Expand Down Expand Up @@ -301,8 +299,33 @@ if(CMAKE_CROSSCOMPILING)
get_property(CMSIS_INCLUDES TARGET CMSIS PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(WALLY_INCLUDES TARGET wallycore PROPERTY INTERFACE_INCLUDE_DIRECTORIES)

set(helper_libraries app_btc-btc app_btc-multi ui_common components workflows)
add_library(app_btc-btc ${APP-BTC-SOURCES})
target_compile_definitions(app_btc-btc PUBLIC "APP_BTC=1" "APP_LTC=0")

add_library(app_btc-multi ${APP-BTC-SOURCES})
target_compile_definitions(app_btc-multi PUBLIC "APP_BTC=1" "APP_LTC=1")
target_link_libraries(app_btc-multi noiseprotocol wallycore secp256k1 util)

add_library(ui_common ${DBB-FIRMWARE-UI-COMMON-SOURCES})

add_library(components ${DBB-FIRMWARE-COMPONENT-SOURCES})
target_link_libraries(components ui_common)

add_library(workflows ${DBB-FIRMWARE-WORKFLOW-SOURCES})
target_link_libraries(workflows components)

foreach(include ${INCLUDES} ${SYSTEMINCLUDES} ${SAMD51A_INCLUDES} ${ASF4_INCLUDES} ${ASF4_MIN_INCLUDES} ${CMSIS_INCLUDES} ${NANOPB_INCLUDE_DIRS} ${WALLY_INCLUDES})
list(APPEND RUST_INCLUDES -I${include})
target_include_directories(components SYSTEM PRIVATE ${include})
target_include_directories(workflows SYSTEM PRIVATE ${include})
foreach (library ${helper_libraries})
target_include_directories(${library} PRIVATE ${INCLUDES})
target_include_directories(${library} SYSTEM PUBLIC ${SYSTEMINCLUDES})
target_include_directories(${library} SYSTEM PUBLIC ${NANOPB_INCLUDE_DIRS})
target_include_directories(${library} SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/src)
target_link_libraries(${library} base32 noiseprotocol wallycore secp256k1 util)
endforeach()
endforeach()

if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
Expand All @@ -313,6 +336,8 @@ if(CMAKE_CROSSCOMPILING)
set(RUSTFLAGS --remap-path-prefix=${CMAKE_CURRENT_SOURCE_DIR}/rust=src)
endif()

add_dependencies(workflows generate-protobufs)

set(LIBBITBOX02_RUST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rust/bitbox02-rust)
set(LIBBITBOX02_RUST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/rust/bitbox02-rust/target)
set(LIBBITBOX02_RUST ${CMAKE_CURRENT_BINARY_DIR}/rust/bitbox02-rust/target/thumbv7em-none-eabi/${RUST_PROFILE}/libbitbox02_rust.a)
Expand Down Expand Up @@ -408,7 +433,7 @@ if(CMAKE_CROSSCOMPILING)
set(HEAP_SIZE ${HEAP_SIZE} PARENT_SCOPE)

add_library(bitbox02-platform ${PLATFORM-BITBOX02-SOURCES})
target_link_libraries(bitbox02-platform asf4-drivers-min util)
target_link_libraries(bitbox02-platform asf4-drivers-min util workflows)
target_include_directories(bitbox02-platform PRIVATE ${INCLUDES})
target_include_directories(bitbox02-platform SYSTEM PUBLIC ${SYSTEMINCLUDES})
target_include_directories(bitbox02-platform SYSTEM PUBLIC ${NANOPB_INCLUDE_DIRS})
Expand All @@ -422,7 +447,7 @@ if(CMAKE_CROSSCOMPILING)
#endif()

add_library(bitboxbase-platform ${PLATFORM-BITBOXBASE-SOURCES})
target_link_libraries(bitboxbase-platform asf4-drivers util)
target_link_libraries(bitboxbase-platform asf4-drivers util workflows)
target_include_directories(bitboxbase-platform PRIVATE ${INCLUDES})
target_include_directories(bitboxbase-platform SYSTEM PUBLIC ${SYSTEMINCLUDES})
target_include_directories(bitboxbase-platform SYSTEM PUBLIC ${NANOPB_INCLUDE_DIRS})
Expand Down
1 change: 1 addition & 0 deletions src/bitboxbase/bitboxbase_background.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <ui/components/image.h>
#include <ui/components/label.h>
#include <ui/components/ui_images.h>
#include <ui/components/ui_logos.h>
#include <ui/event.h>
#include <ui/oled/oled.h>
#include <ui/screen_stack.h>
Expand Down
1 change: 1 addition & 0 deletions src/bootloader/bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <pukcc/curve_p256.h>
#include <screen.h>
#include <ui/components/ui_images.h>
#include <ui/components/ui_logos.h>
#include <ui/oled/oled.h>
#include <ui/ugui/ugui.h>
#if PLATFORM_BITBOXBASE == 1
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/show_logo.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "show_logo.h"
#include "image.h"
#include "ui_images.h"
#include "ui_logos.h"

#include <hardfault.h>
#include <screen.h>
Expand Down
68 changes: 0 additions & 68 deletions src/ui/components/ui_images.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,74 +20,6 @@
#include <stdbool.h>
#include <stdint.h>

#if PRODUCT_BITBOX_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_BASE == 1 || PRODUCT_BITBOXBASE_FACTORYSETUP == 1

#define IMAGE_BB2_LOGO_W 96
#define IMAGE_BB2_LOGO_H 13

static const uint8_t IMAGE_BB2_LOGO[] = {
0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0c, 0x30, 0x7f,
0x80, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0xc1, 0x80, 0x30, 0x60, 0xc0, 0x00, 0x00, 0x08,
0x20, 0x00, 0x00, 0x00, 0xc1, 0x8c, 0xfc, 0x60, 0xc1, 0xf0, 0xe3, 0x88, 0x10, 0x00, 0x00, 0x00,
0xc1, 0x8c, 0xfc, 0x60, 0xc3, 0xf8, 0x63, 0x08, 0x10, 0x70, 0x78, 0x3c, 0xff, 0x0c, 0x30, 0x7f,
0x83, 0x18, 0x36, 0x08, 0x10, 0x88, 0x84, 0x42, 0xff, 0x0c, 0x30, 0x7f, 0x86, 0x0c, 0x3e, 0x0f,
0xe1, 0x04, 0x80, 0x81, 0xc1, 0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x10, 0x04, 0x80, 0x81,
0xc1, 0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x08, 0xfc, 0x78, 0xff, 0xc1, 0x8c, 0x30, 0x60,
0xc6, 0x0c, 0x3e, 0x08, 0x09, 0x04, 0x04, 0x80, 0xc1, 0x8c, 0x30, 0x60, 0xc3, 0x18, 0x36, 0x08,
0x09, 0x04, 0x04, 0x80, 0xff, 0x0c, 0x3c, 0x7f, 0x83, 0xf8, 0x63, 0x08, 0x11, 0x0c, 0x84, 0x41,
0xfe, 0x0c, 0x1c, 0x7f, 0x01, 0xf0, 0xe3, 0x8f, 0xe0, 0xf4, 0x78, 0x3e};

#elif (PRODUCT_BITBOX_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

#define IMAGE_ROTATE_W 22
#define IMAGE_ROTATE_H 14

Expand Down
87 changes: 87 additions & 0 deletions src/ui/components/ui_logos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright 2019 Shift Cryptosecurity AG
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef __UI_LOGOS_H
#define __UI_LOGOS_H

#include <stdint.h>
#if PRODUCT_BITBOX_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_BASE == 1 || PRODUCT_BITBOXBASE_FACTORYSETUP == 1

#define IMAGE_BB2_LOGO_W 96
#define IMAGE_BB2_LOGO_H 13

static const uint8_t IMAGE_BB2_LOGO[] = {
0xfe, 0x0c, 0x30, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0c, 0x30, 0x7f,
0x80, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0xc1, 0x80, 0x30, 0x60, 0xc0, 0x00, 0x00, 0x08,
0x20, 0x00, 0x00, 0x00, 0xc1, 0x8c, 0xfc, 0x60, 0xc1, 0xf0, 0xe3, 0x88, 0x10, 0x00, 0x00, 0x00,
0xc1, 0x8c, 0xfc, 0x60, 0xc3, 0xf8, 0x63, 0x08, 0x10, 0x70, 0x78, 0x3c, 0xff, 0x0c, 0x30, 0x7f,
0x83, 0x18, 0x36, 0x08, 0x10, 0x88, 0x84, 0x42, 0xff, 0x0c, 0x30, 0x7f, 0x86, 0x0c, 0x3e, 0x0f,
0xe1, 0x04, 0x80, 0x81, 0xc1, 0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x10, 0x04, 0x80, 0x81,
0xc1, 0x8c, 0x30, 0x60, 0xc6, 0x0c, 0x1c, 0x08, 0x08, 0xfc, 0x78, 0xff, 0xc1, 0x8c, 0x30, 0x60,
0xc6, 0x0c, 0x3e, 0x08, 0x09, 0x04, 0x04, 0x80, 0xc1, 0x8c, 0x30, 0x60, 0xc3, 0x18, 0x36, 0x08,
0x09, 0x04, 0x04, 0x80, 0xff, 0x0c, 0x3c, 0x7f, 0x83, 0xf8, 0x63, 0x08, 0x11, 0x0c, 0x84, 0x41,
0xfe, 0x0c, 0x1c, 0x7f, 0x01, 0xf0, 0xe3, 0x8f, 0xe0, 0xf4, 0x78, 0x3e};

#elif (PRODUCT_BITBOX_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

#endif // __UI_LOGOS_H
1 change: 1 addition & 0 deletions src/ui/components/waiting.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "image.h"
#include "ui_images.h"
#include "ui_logos.h"

#include <hardfault.h>
#include <random.h>
Expand Down
1 change: 1 addition & 0 deletions test/device-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ foreach(name ${BB02_TEST_LIST})
target_link_libraries(${elf}
PRIVATE
c
workflows
bitbox02-test-platform
asf4-drivers-min
${QTOUCHLIB_A}
Expand Down
Loading

0 comments on commit 58fe31e

Please sign in to comment.