Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API LEVEL 12 #379

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.defines
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 10 additions & 1 deletion include/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 9 additions & 1 deletion include/seproxyhal_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib_nbgl/src/nbgl_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down