diff --git a/lib_ux_sync/include/ux_sync.h b/lib_ux_sync/include/ux_sync.h index 938ffe10e..97710b76b 100644 --- a/lib_ux_sync/include/ux_sync.h +++ b/lib_ux_sync/include/ux_sync.h @@ -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, diff --git a/lib_ux_sync/src/ux_sync.c b/lib_ux_sync/src/ux_sync.c index ffc977e8f..ecc8edc4e 100644 --- a/lib_ux_sync/src/ux_sync.c +++ b/lib_ux_sync/src/ux_sync.c @@ -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.