Skip to content

Commit

Permalink
lib_ux/include/ux.h: Fix LNX and LNSP version of UX_WAIT_DISPLAYED()
Browse files Browse the repository at this point in the history
On devices where the SE drives the screen, there is no need for seph
exchanges to control the screen.
The previous version was assuming UX_DISPLAY_NEXT_ELEMENT() was changing
the state of the MCU <-> SE exchanges, which is false, this was leading
to a deadlock on Speculos.
  • Loading branch information
Xavier Chapron committed Nov 28, 2023
1 parent 606d0e0 commit 1b75b43
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib_ux/include/ux.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,12 @@ extern bolos_ux_params_t G_ux_params;
* Macro to process sequentially display a screen. The call finishes when the UX is completely
* displayed, and the state of the MCU <-> SE exchanges is the same as before this macro call.
*/
#ifdef HAVE_SE_SCREEN
#define UX_WAIT_DISPLAYED() \
while (!UX_DISPLAYED()) { \
UX_DISPLAY_NEXT_ELEMENT(); \
}
#else
#define UX_WAIT_DISPLAYED() \
while (!UX_DISPLAYED()) { \
/* We wait for the MCU event (should indicate display processed for a bagl element) */ \
Expand All @@ -594,6 +600,7 @@ extern bolos_ux_params_t G_ux_params;
io_seproxyhal_general_status(); \
/* We wait for an ack of the MCU. */ \
io_seproxyhal_spi_recv(G_io_seproxyhal_spi_buffer, sizeof(G_io_seproxyhal_spi_buffer), 0);
#endif

/**
* Process button push events. Application's button event handler is called only if the ux app does
Expand Down

0 comments on commit 1b75b43

Please sign in to comment.