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

Rename HAVE_DISPLAY_FAST_MODE define #684

Merged
merged 1 commit into from
Jun 7, 2024
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
2 changes: 1 addition & 1 deletion Makefile.defines
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ DEFINES += HAVE_SE_EINK_DISPLAY
DEFINES += NBGL_PAGE
DEFINES += NBGL_USE_CASE
DEFINES += SCREEN_SIZE_WALLET
DEFINES += HAVE_DISPLAY_FAST_MODE
DEFINES += HAVE_FAST_HOLD_TO_APPROVE
endif # TARGET_FLEX

# For other devices, by default NBGL is not used
Expand Down
6 changes: 3 additions & 3 deletions lib_nbgl/src/nbgl_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static uint8_t nbTouchableControls = 0;
* STATIC PROTOTYPES
**********************/

#ifdef HAVE_DISPLAY_FAST_MODE
#ifdef HAVE_FAST_HOLD_TO_APPROVE
// Unit step in % of touchable progress bar
#define HOLD_TO_APPROVE_STEP_PERCENT (7)
// Duration in ms the user must hold the progress bar
Expand All @@ -124,11 +124,11 @@ static uint8_t nbTouchableControls = 0;
#else
#define HOLD_TO_APPROVE_STEP_PERCENT (25)
#define HOLD_TO_APPROVE_STEP_DURATION_MS (400)
#endif // HAVE_DISPLAY_FAST_MODE
#endif // HAVE_FAST_HOLD_TO_APPROVE

static inline uint8_t get_hold_to_approve_percent(uint32_t touch_duration)
{
#ifdef HAVE_DISPLAY_FAST_MODE
#ifdef HAVE_FAST_HOLD_TO_APPROVE
uint8_t current_step_nb = (touch_duration / HOLD_TO_APPROVE_STEP_DURATION_MS);
#else
uint8_t current_step_nb = (touch_duration / HOLD_TO_APPROVE_STEP_DURATION_MS) + 1;
Expand Down
Loading