From 159160873597fe1fae6c518118a1287c9e7407ef Mon Sep 17 00:00:00 2001 From: Arthur Bonnaudet Date: Fri, 28 Jul 2023 16:01:45 +0200 Subject: [PATCH] Fat: Configure display fast mode syscall --- include/syscalls.h | 7 ++++++- lib_nbgl/include/nbgl_screen.h | 7 +++++++ src/syscalls.c | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/syscalls.h b/include/syscalls.h index 32726b426..91458f9ba 100644 --- a/include/syscalls.h +++ b/include/syscalls.h @@ -299,7 +299,12 @@ #define SYSCALL_nbgl_front_draw_img_rle_ID 0x05fa0010 #ifdef HAVE_DISPLAY_FAST_MODE #define SYSCALL_nbgl_screen_update_temperature_ID 0x01fa0011 -#endif +#endif // HAVE_DISPLAY_FAST_MODE + +#ifdef HAVE_CONFIGURABLE_DISPLAY_FAST_MODE +#define SYSCALL_nbgl_screen_config_fast_mode_ID 0x00fa0012 +#endif // HAVE_CONFIGURABLE_DISPLAY_FAST_MODE +#endif // HAVE_NBGL #ifdef HAVE_BACKGROUND_IMG #define SYSCALL_fetch_background_img 0x01fa0009 diff --git a/lib_nbgl/include/nbgl_screen.h b/lib_nbgl/include/nbgl_screen.h index 3c67101eb..935b257c1 100644 --- a/lib_nbgl/include/nbgl_screen.h +++ b/lib_nbgl/include/nbgl_screen.h @@ -60,7 +60,14 @@ typedef struct PACKED__ nbgl_screen_s { **********************/ unsigned int nbgl_screen_reinit(void); + +#ifdef HAVE_DISPLAY_FAST_MODE void nbgl_screen_update_temperature(uint8_t temp_degrees); +#endif // HAVE_DISPLAY_FAST_MODE + +#ifdef HAVE_CONFIGURABLE_DISPLAY_FAST_MODE +void nbgl_screen_config_fast_mode(uint8_t fast_mode_setting); +#endif // HAVE_CONFIGURABLE_DISPLAY_FAST_MODE void nbgl_screenRedraw(void); nbgl_obj_t *nbgl_screenGetTop(void); diff --git a/src/syscalls.c b/src/syscalls.c index 6a0b7ea9e..2a78aff15 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -177,6 +177,15 @@ void nbgl_screen_update_temperature(uint8_t temp_degrees) } #endif // HAVE_DISPLAY_FAST_MODE +#ifdef HAVE_CONFIGURABLE_DISPLAY_FAST_MODE +void nbgl_screen_config_fast_mode(uint8_t fast_mode_setting) +{ + unsigned int parameters[1]; + parameters[0] = (unsigned int) fast_mode_setting; + SVC_Call(SYSCALL_nbgl_screen_config_fast_mode_ID, parameters); +} +#endif // HAVE_CONFIGURABLE_DISPLAY_FAST_MODE + #endif void nvm_write ( void * dst_adr, void * src_adr, unsigned int src_len ) {