Skip to content

Commit

Permalink
Avoid unwanted pin lock during io reset
Browse files Browse the repository at this point in the history
- BOLOS_UX_IO_RESET event:
  Warns the UX layer that an IO reset will happen.
  It allows UX layer to anticipate jitter in USB values and avoid undesired pin locks.
  • Loading branch information
abonnaudet-ledger committed Dec 12, 2023
1 parent 0e72792 commit d337002
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/os_ux.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ typedef enum bolos_ux_e {
BOLOS_UX_ASYNCHMODAL_PAIRING_REQUEST, // ask the ux to display a modal to accept/reject the
// current pairing request
BOLOS_UX_ASYNCHMODAL_PAIRING_CANCEL,
BOLOS_UX_IO_RESET,
BOLOS_UX_LAST_ID,
} bolos_ux_t;

Expand Down
7 changes: 7 additions & 0 deletions src/os_io_seproxyhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,13 @@ void io_seproxyhal_init(void)
app_stack_canary = APP_STACK_CANARY_MAGIC;
#endif // HAVE_BOLOS_APP_STACK_CANARY

#if !defined(HAVE_BOLOS) && !defined(BOLOS_OS_UPGRADER_APP)
// Warn UX layer of io reset to avoid unwanted pin lock
memset(&G_ux_params, 0, sizeof(G_ux_params));
G_ux_params.ux_id = BOLOS_UX_IO_RESET;
os_ux(&G_ux_params);
#endif

// wipe the io structure before it's used
#ifdef HAVE_BLE
unsigned int plane = G_io_app.plane_mode;
Expand Down

0 comments on commit d337002

Please sign in to comment.