diff --git a/legacy/bootloader/Makefile b/legacy/bootloader/Makefile index 8c3df1499..944252823 100644 --- a/legacy/bootloader/Makefile +++ b/legacy/bootloader/Makefile @@ -4,6 +4,13 @@ OBJS += bootloader.o OBJS += signatures.o OBJS += usb.o +# overrides from libtrezor +CFLAGS += -DFONT_SKIP_FIXED=1 +OBJS += ../gen/fonts.small.o + +# overrides from trezor-crypto +CFLAGS += -DUSE_PRECOMPUTED_IV=0 +CFLAGS += -DUSE_PRECOMPUTED_CP=0 OBJS += ../vendor/trezor-crypto/bignum.small.o OBJS += ../vendor/trezor-crypto/ecdsa.small.o OBJS += ../vendor/trezor-crypto/secp256k1.small.o @@ -11,9 +18,6 @@ OBJS += ../vendor/trezor-crypto/sha2.small.o OBJS += ../vendor/trezor-crypto/memzero.small.o OBJS += ../vendor/trezor-crypto/hmac_drbg.small.o -CFLAGS += -DUSE_PRECOMPUTED_IV=0 -CFLAGS += -DUSE_PRECOMPUTED_CP=0 - OPTFLAGS ?= -Os include ../Makefile.include diff --git a/legacy/gen/fonts.c b/legacy/gen/fonts.c index c41114b1a..a4458935e 100644 --- a/legacy/gen/fonts.c +++ b/legacy/gen/fonts.c @@ -1,14 +1,14 @@ #include "fonts.h" -#define FONTS 2 - const uint8_t *const font_data[FONTS][128 - 32] = { { #include "font.inc" }, +#ifndef FONT_SKIP_FIXED { #include "fontfixed.inc" }, +#endif }; int fontCharWidth(uint8_t font, uint8_t c) { diff --git a/legacy/gen/fonts.h b/legacy/gen/fonts.h index 6d691aed0..e30c2f3f5 100644 --- a/legacy/gen/fonts.h +++ b/legacy/gen/fonts.h @@ -5,10 +5,17 @@ #define FONT_HEIGHT 8 #define FONT_STANDARD 0 + +#ifndef FONT_SKIP_FIXED #define FONT_FIXED 1 +#define FONTS 2 +#else +#define FONTS 1 +#endif + #define FONT_DOUBLE 0x80 -extern const uint8_t *const font_data[2][128 - 32]; +extern const uint8_t *const font_data[FONTS][128 - 32]; int fontCharWidth(uint8_t font, uint8_t c); const uint8_t *fontCharData(uint8_t font, uint8_t c);