From 7476e9463f65165da081c8f582de0ab6a632c7ba Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 9 Nov 2019 18:54:13 +0000 Subject: [PATCH] legacy/bootloader: don't include FONT_FIXED --- legacy/bootloader/Makefile | 10 +++++++--- legacy/gen/fonts.c | 4 ++-- legacy/gen/fonts.h | 9 ++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) 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);