diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e4037e4541..c31851ac31 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) @@ -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 @@ -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 @@ -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} @@ -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") @@ -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) @@ -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}) @@ -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}) diff --git a/src/bitboxbase/bitboxbase_background.c b/src/bitboxbase/bitboxbase_background.c index 8b1cdd6227..6f9f1a53ca 100644 --- a/src/bitboxbase/bitboxbase_background.c +++ b/src/bitboxbase/bitboxbase_background.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/bootloader/bootloader.c b/src/bootloader/bootloader.c index 44ef43d69f..ada53cb85f 100644 --- a/src/bootloader/bootloader.c +++ b/src/bootloader/bootloader.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #if PLATFORM_BITBOXBASE == 1 diff --git a/src/ui/components/show_logo.c b/src/ui/components/show_logo.c index 819250a037..25abe70d60 100644 --- a/src/ui/components/show_logo.c +++ b/src/ui/components/show_logo.c @@ -15,6 +15,7 @@ #include "show_logo.h" #include "image.h" #include "ui_images.h" +#include "ui_logos.h" #include #include diff --git a/src/ui/components/ui_images.h b/src/ui/components/ui_images.h index e1d8cee5f4..bcd97eb7e2 100644 --- a/src/ui/components/ui_images.h +++ b/src/ui/components/ui_images.h @@ -20,74 +20,6 @@ #include #include -#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 diff --git a/src/ui/components/ui_logos.h b/src/ui/components/ui_logos.h new file mode 100644 index 0000000000..1f1ed2b925 --- /dev/null +++ b/src/ui/components/ui_logos.h @@ -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 +#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 diff --git a/src/ui/components/waiting.c b/src/ui/components/waiting.c index e9fa3bc8f0..6b849439e7 100644 --- a/src/ui/components/waiting.c +++ b/src/ui/components/waiting.c @@ -16,6 +16,7 @@ #include "image.h" #include "ui_images.h" +#include "ui_logos.h" #include #include diff --git a/test/device-test/CMakeLists.txt b/test/device-test/CMakeLists.txt index 2ff50a9f6c..76cd3273e0 100644 --- a/test/device-test/CMakeLists.txt +++ b/test/device-test/CMakeLists.txt @@ -133,6 +133,7 @@ foreach(name ${BB02_TEST_LIST}) target_link_libraries(${elf} PRIVATE c + workflows bitbox02-test-platform asf4-drivers-min ${QTOUCHLIB_A} diff --git a/test/unit-test/CMakeLists.txt b/test/unit-test/CMakeLists.txt index 7387715732..6fa4d9a92e 100644 --- a/test/unit-test/CMakeLists.txt +++ b/test/unit-test/CMakeLists.txt @@ -36,7 +36,10 @@ find_package(Nanopb REQUIRED) add_library(bitbox STATIC ${DBB-FIRMWARE-COMMON-SOURCES} + ${DBB-FIRMWARE-COMPONENT-SOURCES} + ${DBB-FIRMWARE-WORKFLOW-SOURCES} ${APP-BTC-SOURCES} + ${DBB-FIRMWARE-UI-COMMON-SOURCES} ${DBB-FIRMWARE-UI-SOURCES} ${DBB-FIRMWARE-PROTOBUF-SOURCES} ${DBB-FIRMWARE-USB-SOURCES}