From 1a91ed68496d60318c0a119df375d4923d4c1b76 Mon Sep 17 00:00:00 2001 From: Jorge Martins Date: Tue, 18 Jul 2023 17:54:43 +0200 Subject: [PATCH 1/3] fix undefined behaviour --- lib_nbgl/src/nbgl_use_case.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_nbgl/src/nbgl_use_case.c b/lib_nbgl/src/nbgl_use_case.c index d5511cc11..26c555af8 100644 --- a/lib_nbgl/src/nbgl_use_case.c +++ b/lib_nbgl/src/nbgl_use_case.c @@ -289,7 +289,7 @@ static void displaySettingsPage(uint8_t page, bool forceFullRefresh) { // function used to display the current page in review static void displayReviewPage(uint8_t page, bool forceFullRefresh) { - nbgl_pageContent_t content; + nbgl_pageContent_t content = {0}; // ensure the page is valid if ((navInfo.nbPages != 0) && (page >= (navInfo.nbPages))) { From c7b4b11389d02a56db07add0d7b7a339a765afb5 Mon Sep 17 00:00:00 2001 From: Arthur Bonnaudet Date: Mon, 3 Jul 2023 11:23:44 +0200 Subject: [PATCH 2/3] Fat: Add errors and seph tags relative to Qi flash --- include/errors.h | 11 ++++++++++- include/seproxyhal_protocol.h | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/errors.h b/include/errors.h index e759795f8..7f46d5fa4 100644 --- a/include/errors.h +++ b/include/errors.h @@ -123,7 +123,11 @@ enum generic_identifiers { ERR_GEN_ID_35, ERR_GEN_ID_36, ERR_GEN_ID_37, - ERR_GEN_ID_38 + ERR_GEN_ID_38, + ERR_GEN_ID_39, + ERR_GEN_ID_3A, + ERR_GEN_ID_3B, + ERR_GEN_ID_3C }; /** @@ -622,6 +626,7 @@ enum generic_identifiers { #define SWO_APD_LEN_2F (ERR_APD_LEN + ERR_GEN_ID_2F) // 0x672F #define SWO_APD_LEN_30 (ERR_APD_LEN + ERR_GEN_ID_30) // 0x6730 #define SWO_APD_LEN_31 (ERR_APD_LEN + ERR_GEN_ID_31) // 0x6731 +#define SWO_APD_LEN_32 (ERR_APD_LEN + ERR_GEN_ID_32) // 0x6732 #define SWO_APD_DAT_01 (ERR_APD_DAT + ERR_GEN_ID_01) // 0x6801 #define SWO_APD_DAT_02 (ERR_APD_DAT + ERR_GEN_ID_02) // 0x6802 @@ -731,6 +736,10 @@ enum generic_identifiers { #define SWO_APD_STA_36 (ERR_APD_STA + ERR_GEN_ID_36) // 0x6636 #define SWO_APD_STA_37 (ERR_APD_STA + ERR_GEN_ID_37) // 0x6637 #define SWO_APD_STA_38 (ERR_APD_STA + ERR_GEN_ID_38) // 0x6638 +#define SWO_APD_STA_39 (ERR_APD_STA + ERR_GEN_ID_39) // 0x6639 +#define SWO_APD_STA_3A (ERR_APD_STA + ERR_GEN_ID_3A) // 0x663A +#define SWO_APD_STA_3B (ERR_APD_STA + ERR_GEN_ID_3B) // 0x663B +#define SWO_APD_STA_3C (ERR_APD_STA + ERR_GEN_ID_3C) // 0x663C /** * The process is successful. diff --git a/include/seproxyhal_protocol.h b/include/seproxyhal_protocol.h index 773a0b0a5..20dade09e 100644 --- a/include/seproxyhal_protocol.h +++ b/include/seproxyhal_protocol.h @@ -106,7 +106,11 @@ #define SEPROXYHAL_TAG_NFC_APDU_EVENT 0x1C #endif -#define SEPH_PROTOCOL_EVT_POWER_BUTTON_EVENT 0x1B // +#define SEPH_PROTOCOL_EVT_POWER_BUTTON_EVENT 0x1B + +#ifdef HAVE_QI_FLASH +#define SEPROXYHAL_TAG_STATUS_EVENT_QI_FLASH_CHECKSUM 0x1D +#endif // COMMANDS #ifdef HAVE_SEPROXYHAL_MCU @@ -195,6 +199,10 @@ #define SEPROXYHAL_TAG_PLAY_TUNE 0x56 #endif // HAVE_PIEZO_SOUND +#ifdef HAVE_QI_FLASH +#define SEPROXYHAL_TAG_QI_FLASH 0x58 +#endif + #ifdef HAVE_SHIP_MODE #define SEPH_PROTOCOL_CMD_SET_SHIP_MODE 0x57 #endif // HAVE_SHIP_MODE From 81647bb0afa5eda146c5e8cbff8198790adb785b Mon Sep 17 00:00:00 2001 From: Arthur Bonnaudet Date: Tue, 18 Jul 2023 14:32:10 +0200 Subject: [PATCH 3/3] Fat: Disable display fast mode --- Makefile.defines | 1 + lib_nbgl/src/nbgl_layout.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Makefile.defines b/Makefile.defines index 269c539b6..8002b817c 100644 --- a/Makefile.defines +++ b/Makefile.defines @@ -200,6 +200,7 @@ DEFINES += HAVE_PIEZO_SOUND DEFINES += HAVE_SE_TOUCH DEFINES += NBGL_PAGE DEFINES += NBGL_USE_CASE +#DEFINES += HAVE_DISPLAY_FAST_MODE endif ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_NANOS2)) diff --git a/lib_nbgl/src/nbgl_layout.c b/lib_nbgl/src/nbgl_layout.c index 3c5c86639..709f8b7dd 100644 --- a/lib_nbgl/src/nbgl_layout.c +++ b/lib_nbgl/src/nbgl_layout.c @@ -120,12 +120,17 @@ static char numText[5]; * STATIC PROTOTYPES **********************/ +#ifdef HAVE_DISPLAY_FAST_MODE // Unit step in % of touchable progress bar #define HOLD_TO_APPROVE_STEP_PERCENT (10) // Duration in ms the user must hold the progress bar // to make it progress HOLD_TO_APPROVE_STEP_PERCENT %. // This duration must be higher than the screen refresh duration. #define HOLD_TO_APPROVE_STEP_DURATION_MS (150) +#else +#define HOLD_TO_APPROVE_STEP_PERCENT (17) +#define HOLD_TO_APPROVE_STEP_DURATION_MS (400) +#endif // HAVE_DISPLAY_FAST_MODE static inline uint8_t get_hold_to_approve_percent(uint32_t touch_duration) { uint8_t current_step_nb = (touch_duration / HOLD_TO_APPROVE_STEP_DURATION_MS) + 1;