Skip to content

Commit

Permalink
Put fonts in Shared library to access them without syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
nroggeman-ledger committed Sep 17, 2024
1 parent af34749 commit 8f7d820
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
6 changes: 3 additions & 3 deletions include/shared_trampoline.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#elif defined(TARGET_NANOX)
#define SHARED_TRAMPOLINE_ADDR 0x00210001
#elif defined(TARGET_NANOS2)
#define SHARED_TRAMPOLINE_ADDR 0x00810001
#define SHARED_TRAMPOLINE_ADDR 0x00808001
#elif defined(TARGET_STAX)
#define SHARED_TRAMPOLINE_ADDR 0x00818001
#define SHARED_TRAMPOLINE_ADDR 0x00810001
#elif defined(TARGET_FLEX)
#define SHARED_TRAMPOLINE_ADDR 0x00818001
#define SHARED_TRAMPOLINE_ADDR 0x00810001
#endif
1 change: 0 additions & 1 deletion lib_nbgl/include/nbgl_fonts.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ typedef struct nbgl_unicode_ctx_s {
/**********************
* GLOBAL PROTOTYPES
**********************/
const nbgl_font_t *nbgl_font_getFont(unsigned int fontId);
const nbgl_font_t *nbgl_getFont(nbgl_font_id_e fontId);
uint16_t nbgl_getSingleLineTextWidth(nbgl_font_id_e fontId, const char *text);
uint16_t nbgl_getSingleLineTextWidthInLen(nbgl_font_id_e fontId, const char *text, uint16_t maxLen);
Expand Down
11 changes: 1 addition & 10 deletions lib_nbgl/src/nbgl_fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ static nbgl_unicode_ctx_t unicodeCtx = {0};
static const LANGUAGE_PACK *language_pack;
#endif // HAVE_LANGUAGE_PACK

#if defined(BOLOS_OS_UPGRADER_APP)
#ifdef SCREEN_SIZE_WALLET
#ifdef TARGET_STAX
#include "nbgl_font_inter_regular_24.inc"
Expand Down Expand Up @@ -74,8 +73,6 @@ const nbgl_font_t *const C_nbgl_fonts[] = {
};
const unsigned int C_nbgl_fonts_count = sizeof(C_nbgl_fonts) / sizeof(C_nbgl_fonts[0]);

#endif

#if (defined(HAVE_BOLOS) && !defined(BOLOS_OS_UPGRADER_APP))
#if !defined(HAVE_LANGUAGE_PACK)
const nbgl_font_unicode_t *const C_nbgl_fonts_unicode[] = {
Expand Down Expand Up @@ -116,7 +113,6 @@ bool hard_caesura = false;
* @param fontId font ID
* @return the found font or NULL
*/
#if defined(BOLOS_OS_UPGRADER_APP)
const nbgl_font_t *nbgl_getFont(nbgl_font_id_e fontId)
{
unsigned int i = C_nbgl_fonts_count;
Expand All @@ -132,12 +128,7 @@ const nbgl_font_t *nbgl_getFont(nbgl_font_id_e fontId)
// id not found
return NULL;
}
#else
const nbgl_font_t *nbgl_getFont(nbgl_font_id_e fontId)
{
return nbgl_font_getFont(fontId);
}
#endif // BOLOS_OS_UPGRADER_APP

/**
* @brief Get the coming unicode value on the given UTF-8 string. If the value is a simple ASCII
* character, is_unicode is set to false.
Expand Down
7 changes: 0 additions & 7 deletions src/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,6 @@ void nbgl_sideRefreshArea(nbgl_area_t *area, nbgl_post_refresh_t post_refresh)
return;
}

const nbgl_font_t *nbgl_font_getFont(unsigned int fontId)
{
unsigned int parameters[1];
parameters[0] = (unsigned int) fontId;
return (const nbgl_font_t *) SVC_Call(SYSCALL_nbgl_get_font_ID, parameters);
}

void nbgl_screen_reinit(void)
{
unsigned int parameters[1];
Expand Down

0 comments on commit 8f7d820

Please sign in to comment.