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

Ux sync public callbacks #705

Merged
merged 1 commit into from
Jun 24, 2024
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
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
Loading