Skip to content

Commit

Permalink
Add setter functions in ux_sync lib for synchronous call return code …
Browse files Browse the repository at this point in the history
…and "end of flow" variables.
  • Loading branch information
agrojean-ledger committed Jun 24, 2024
1 parent 481a418 commit 05c2e5f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib_ux_sync/include/ux_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ typedef enum {
UX_SYNC_RET_ERROR
} ux_sync_ret_t;

void ux_sync_setReturnCode(ux_sync_ret_t ret);

void ux_sync_setEnded(bool ended);

ux_sync_ret_t ux_sync_homeAndSettings(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
Expand Down
22 changes: 22 additions & 0 deletions lib_ux_sync/src/ux_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ static ux_sync_ret_t ux_sync_wait(bool exitOnApdu)
return g_ret;
}

/**
* @brief Sets the return code of synchronous UX calls. Can be used by content action callbacks
* defined by application code.
*
* @param ret return code to set.
*/
void ux_sync_setReturnCode(ux_sync_ret_t ret)
{
g_ret = ret;
}

/**
* @brief Sets the ended flag of synchronous UX calls. Can be used by content action callbacks
* defined by application code to end the UX flow.
*
* @param ended flag to set.
*/
void ux_sync_setEnded(bool ended)
{
g_ended = ended;
}

/**
* @brief Draws the extended version of home page of an app (page on which we land when launching it
* from dashboard) with automatic support of setting display.
Expand Down

0 comments on commit 05c2e5f

Please sign in to comment.