Skip to content

Commit

Permalink
Fix BOLOS_UX_IO_RESET message when app boots
Browse files Browse the repository at this point in the history
- The `BOLOS_UX_IO_RESET` allows to avoid unwanted PIN lock when USB layer is reinited
- A defect in the OS make the very first `os_ux` message ignored

Re-send the message allows to ensure the BOLOS_UX_IO_RESET message is received by the UX layer.
  • Loading branch information
abonnaudet-ledger committed Jul 11, 2024
1 parent 86054b8 commit 462fdb7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/os_io_seproxyhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,15 @@ void io_seproxyhal_init(void)
// 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);

// If the app has just been booted from the UX, multiple os_ux calls may be necessary
// to ensure UX layer has take the BOLOS_UX_IO_RESET instruction into account.
for (uint8_t i = 0; i < 2; i++) {
os_ux(&G_ux_params);
if (os_sched_last_status(TASK_BOLOS_UX) == BOLOS_UX_OK) {
break;
}
}
#endif

// wipe the io structure before it's used
Expand Down

0 comments on commit 462fdb7

Please sign in to comment.