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

Fat: Disable display fast mode #376

Merged
merged 1 commit 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
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