Skip to content

Commit

Permalink
Merge pull request #411 from LedgerHQ/xch/fix-standard-app-swap-handling
Browse files Browse the repository at this point in the history
lib_standard_app: Swap fix and improvment
  • Loading branch information
xchapron-ledger authored Sep 1, 2023
2 parents 8b2b9cb + 47532e9 commit e277457
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib_standard_app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

#ifdef HAVE_SWAP
#include "swap.h"

#ifdef HAVE_NBGL
#include "nbgl_use_case.h"
#endif // HAVE_NBGL
#endif // HAVE_SWAP

ux_state_t G_ux;
Expand Down Expand Up @@ -94,9 +98,6 @@ static void standalone_app_main(void) {

#ifdef HAVE_SWAP
static void library_app_main(libargs_t *args) {
G_called_from_swap = true;
G_swap_response_ready = false;

BEGIN_TRY {
TRY {
PRINTF("Inside library\n");
Expand All @@ -107,12 +108,16 @@ static void library_app_main(libargs_t *args) {
// BSS data.
bool success = swap_copy_transaction_parameters(args->create_transaction);
if (success) {
// BSS was wiped, so init these global again
// BSS was wiped, we can now init these globals
G_called_from_swap = true;
G_swap_response_ready = false;

common_app_init();

#ifdef HAVE_NBGL
nbgl_useCaseSpinner("Signing");
#endif // HAVE_NBGL

app_main();
}
break;
Expand Down

0 comments on commit e277457

Please sign in to comment.