Skip to content

Commit

Permalink
Merge branch 'master' into tjo_align_struct_application
Browse files Browse the repository at this point in the history
  • Loading branch information
tjoly-ledger authored Oct 10, 2024
2 parents 9d06fe2 + ab19595 commit afc674a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@
#define QRCODE_REDUCED_ADDR_LEN 128

// macros to ease access to shared contexts
#define keypadContext sharedContext.keypad
#define addressConfirmationContext sharedContext.addressConfirmation
#define blindSigningContext sharedContext.blindSigning
#define keypadContext sharedContext.keypad
#define blindSigningContext sharedContext.blindSigning

/**********************
* TYPEDEFS
Expand Down Expand Up @@ -119,13 +118,12 @@ typedef struct BlindSigningContext_s {
} BlindSigningContext_t;

// this union is intended to save RAM for context storage
// indeed, these three contexts cannot happen simultaneously
// indeed, these 2 contexts cannot happen simultaneously
typedef union {
#ifdef NBGL_KEYPAD
KeypadContext_t keypad;
#endif
AddressConfirmationContext_t addressConfirmation;
BlindSigningContext_t blindSigning;
BlindSigningContext_t blindSigning;
} SharedContext_t;

typedef struct {
Expand Down Expand Up @@ -216,6 +214,9 @@ static DetailsContext_t detailsContext;
// multi-purpose context shared for non-concurrent usages
static SharedContext_t sharedContext;

// context for address review
static AddressConfirmationContext_t addressConfirmationContext;

// contexts for generic navigation
static GenericContext_t genericContext;
static nbgl_content_t
Expand Down Expand Up @@ -713,7 +714,9 @@ static const nbgl_content_t *genericContextComputeNextPageParams(uint8_t

// Handle case where the content to be displayed is in the next content
// In such case start at element index 0.
if (nextElementIdx >= genericContext.currentContentElementNb) {
// If currentContentElementNb == 0, means not initialized, so skip
if ((nextElementIdx >= genericContext.currentContentElementNb)
&& (genericContext.currentContentElementNb > 0)) {
nextContentIdx += 1;
nextElementIdx = 0;
}
Expand Down

0 comments on commit afc674a

Please sign in to comment.