1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

modtrezorui: invert FONT macro inclusion logic

This commit is contained in:
Pavol Rusnak 2017-12-15 23:13:25 +01:00
parent 80707f195b
commit 79a3f84c3c
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
7 changed files with 24 additions and 17 deletions

View File

@ -33,8 +33,7 @@ SOURCE_MOD += [
# modtrezorui # modtrezorui
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_MONO_DISABLE', 'TREZOR_FONT_BOLD_ENABLE',
'TREZOR_FONT_NORMAL_DISABLE',
('QR_MAX_VERSION', '0'), ('QR_MAX_VERSION', '0'),
] ]
SOURCE_MOD += [ SOURCE_MOD += [

View File

@ -70,7 +70,12 @@ SOURCE_MOD += [
] ]
# modtrezorui # modtrezorui
CPPDEFINES_MOD += [('QR_MAX_VERSION', '0')] CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE',
'TREZOR_FONT_MONO_ENABLE',
'TREZOR_FONT_NORMAL_ENABLE',
('QR_MAX_VERSION', '0'),
]
SOURCE_MOD += [ SOURCE_MOD += [
'embed/extmod/modtrezorui/display.c', 'embed/extmod/modtrezorui/display.c',
'embed/extmod/modtrezorui/inflate.c', 'embed/extmod/modtrezorui/inflate.c',

View File

@ -9,8 +9,7 @@ SOURCE_MOD = []
# modtrezorui # modtrezorui
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_MONO_DISABLE', 'TREZOR_FONT_BOLD_ENABLE',
'TREZOR_FONT_NORMAL_DISABLE',
('QR_MAX_VERSION', '0'), ('QR_MAX_VERSION', '0'),
] ]
SOURCE_MOD += [ SOURCE_MOD += [

View File

@ -9,8 +9,7 @@ SOURCE_MOD = []
# modtrezorui # modtrezorui
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_MONO_DISABLE', 'TREZOR_FONT_BOLD_ENABLE',
'TREZOR_FONT_NORMAL_DISABLE',
('QR_MAX_VERSION', '0'), ('QR_MAX_VERSION', '0'),
] ]
SOURCE_MOD += [ SOURCE_MOD += [

View File

@ -71,7 +71,12 @@ SOURCE_MOD += [
] ]
# modtrezorui # modtrezorui
CPPDEFINES_MOD += [('QR_MAX_VERSION', '0')] CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE',
'TREZOR_FONT_MONO_ENABLE',
'TREZOR_FONT_NORMAL_ENABLE',
('QR_MAX_VERSION', '0'),
]
SOURCE_MOD += [ SOURCE_MOD += [
'embed/extmod/modtrezorui/display.c', 'embed/extmod/modtrezorui/display.c',
'embed/extmod/modtrezorui/inflate.c', 'embed/extmod/modtrezorui/inflate.c',

View File

@ -7,13 +7,13 @@
#include "inflate.h" #include "inflate.h"
#include "font_bitmap.h" #include "font_bitmap.h"
#ifndef TREZOR_FONT_MONO_DISABLE #ifdef TREZOR_FONT_MONO_ENABLE
#include "font_robotomono_regular_20.h" #include "font_robotomono_regular_20.h"
#endif #endif
#ifndef TREZOR_FONT_NORMAL_DISABLE #ifdef TREZOR_FONT_NORMAL_ENABLE
#include "font_roboto_regular_20.h" #include "font_roboto_regular_20.h"
#endif #endif
#ifndef TREZOR_FONT_BOLD_DISABLE #ifdef TREZOR_FONT_BOLD_ENABLE
#include "font_roboto_bold_20.h" #include "font_roboto_bold_20.h"
#endif #endif
@ -294,15 +294,15 @@ static const uint8_t *get_glyph(uint8_t font, uint8_t c)
return 0; return 0;
} }
switch (font) { switch (font) {
#ifndef TREZOR_FONT_MONO_DISABLE #ifdef TREZOR_FONT_MONO_ENABLE
case FONT_MONO: case FONT_MONO:
return Font_RobotoMono_Regular_20[c - ' ']; return Font_RobotoMono_Regular_20[c - ' '];
#endif #endif
#ifndef TREZOR_FONT_NORMAL_DISABLE #ifdef TREZOR_FONT_NORMAL_ENABLE
case FONT_NORMAL: case FONT_NORMAL:
return Font_Roboto_Regular_20[c - ' ']; return Font_Roboto_Regular_20[c - ' '];
#endif #endif
#ifndef TREZOR_FONT_BOLD_DISABLE #ifdef TREZOR_FONT_BOLD_ENABLE
case FONT_BOLD: case FONT_BOLD:
return Font_Roboto_Bold_20[c - ' ']; return Font_Roboto_Bold_20[c - ' '];
#endif #endif

View File

@ -19,13 +19,13 @@
#define FONT_BPP 4 #define FONT_BPP 4
#ifndef TREZOR_FONT_MONO_DISABLE #ifdef TREZOR_FONT_MONO_ENABLE
#define FONT_MONO 0 #define FONT_MONO 0
#endif #endif
#ifndef TREZOR_FONT_NORMAL_DISABLE #ifdef TREZOR_FONT_NORMAL_ENABLE
#define FONT_NORMAL 1 #define FONT_NORMAL 1
#endif #endif
#ifndef TREZOR_FONT_BOLD_DISABLE #ifdef TREZOR_FONT_BOLD_ENABLE
#define FONT_BOLD 2 #define FONT_BOLD 2
#endif #endif