From c937f21447966b31e930ae8d20d1093d20e9fa66 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Thu, 14 Sep 2023 22:40:38 +0200 Subject: [PATCH] refactor(core): change the way USE_OPTIGA is added to build [no changelog] --- core/SConscript.bootloader_emu | 3 --- core/SConscript.unix | 3 --- core/embed/bootloader/emulator.c | 1 + core/embed/extmod/modtrezorconfig/norcow_config.h | 1 + core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c | 2 ++ core/embed/trezorhal/boards/board-unix.h | 1 + 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu index af36760f74..37fcd39f8c 100644 --- a/core/SConscript.bootloader_emu +++ b/core/SConscript.bootloader_emu @@ -131,9 +131,6 @@ SOURCE_TREZORHAL = [ ] if TREZOR_MODEL in ('R', ): - CPPDEFINES_MOD += [ - ('USE_OPTIGA', '1'), - ] SOURCE_TREZORHAL += [ 'embed/trezorhal/unix/secret.c', 'embed/trezorhal/unix/optiga_hal.c', diff --git a/core/SConscript.unix b/core/SConscript.unix index 0ee5bf3f9d..7be0f694dd 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -390,9 +390,6 @@ if TREZOR_MODEL in ('T', 'R'): ] if TREZOR_MODEL == 'R': - CPPDEFINES_MOD += [ - ('USE_OPTIGA', '1'), - ] SOURCE_UNIX += [ 'embed/trezorhal/unix/optiga.c', ] diff --git a/core/embed/bootloader/emulator.c b/core/embed/bootloader/emulator.c index 952fde585c..0a82e800d8 100644 --- a/core/embed/bootloader/emulator.c +++ b/core/embed/bootloader/emulator.c @@ -1,6 +1,7 @@ #include #include +#include TREZOR_BOARD #include "bootui.h" #include "common.h" #include "display.h" diff --git a/core/embed/extmod/modtrezorconfig/norcow_config.h b/core/embed/extmod/modtrezorconfig/norcow_config.h index 5104f10235..65cebdcf07 100644 --- a/core/embed/extmod/modtrezorconfig/norcow_config.h +++ b/core/embed/extmod/modtrezorconfig/norcow_config.h @@ -20,6 +20,7 @@ #ifndef __NORCOW_CONFIG_H__ #define __NORCOW_CONFIG_H__ +#include TREZOR_BOARD #include "flash.h" #include "model.h" diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c index 78357644b5..f89b708c0f 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c @@ -25,6 +25,8 @@ #include "py/runtime.h" +#include TREZOR_BOARD + #if MICROPY_PY_TREZORCRYPTO static mp_obj_t ui_wait_callback = mp_const_none; diff --git a/core/embed/trezorhal/boards/board-unix.h b/core/embed/trezorhal/boards/board-unix.h index 99fa6b8aee..ec16dd4ad5 100644 --- a/core/embed/trezorhal/boards/board-unix.h +++ b/core/embed/trezorhal/boards/board-unix.h @@ -16,6 +16,7 @@ #ifdef TREZOR_MODEL_R #define USE_BUTTON 1 #define USE_SBU 1 +#define USE_OPTIGA 1 #endif #include "display-unix.h"