Skip to content

Commit

Permalink
lib_nbgl: Update implementation for LNX and LNSP
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed May 3, 2024
1 parent 0fe45bd commit b543f83
Show file tree
Hide file tree
Showing 4 changed files with 876 additions and 384 deletions.
60 changes: 38 additions & 22 deletions Makefile.standard_app
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,38 @@ ifneq ($(DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE), 1)
endif
endif

#####################################################################
# NBGL #
#####################################################################
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOS TARGET_NANOX TARGET_NANOS2))
ifeq ($(ENABLE_NBGL_FOR_NANO_DEVICES), 1)
USE_NBGL = 1
else
USE_NBGL = 0
endif
else
USE_NBGL = 1
endif

ifeq ($(ENABLE_NBGL_QRCODE), 1)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX))
DEFINES += NBGL_QRCODE
SDK_SOURCE_PATH += qrcode
endif
endif

ifeq ($(ENABLE_NBGL_KEYBOARD), 1)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX))
DEFINES += NBGL_KEYBOARD
endif
endif

ifeq ($(ENABLE_NBGL_KEYPAD), 1)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX))
DEFINES += NBGL_KEYPAD
endif
endif

#####################################################################
# STANDARD DEFINES #
#####################################################################
Expand Down Expand Up @@ -112,7 +144,7 @@ ifneq ($(DISABLE_STANDARD_WEBUSB), 1)
endif

ifneq ($(DISABLE_STANDARD_BAGL_UX_FLOW), 1)
ifeq ($(USE_NBGL),0)
ifneq ($(USE_NBGL), 1)
DEFINES += HAVE_UX_FLOW
endif
endif
Expand All @@ -126,31 +158,15 @@ SDK_SOURCE_PATH += lib_standard_app
endif

ifneq ($(DISABLE_STANDARD_APP_SYNC_RAPDU), 1)
# On LNS only activate it by default if using NBGL.
# This impact stack usage and shouldn't be activated on all apps silently
ifneq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += STANDARD_APP_SYNC_RAPDU
else
ifeq ($(ENABLE_NBGL_FOR_NANO_DEVICES), 1)
DEFINES += STANDARD_APP_SYNC_RAPDU
endif
endif

#####################################################################
# NBGL #
#####################################################################
ifeq ($(ENABLE_NBGL_QRCODE), 1)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX))
DEFINES += NBGL_QRCODE
SDK_SOURCE_PATH += qrcode
endif
endif

ifeq ($(ENABLE_NBGL_KEYBOARD), 1)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX))
DEFINES += NBGL_KEYBOARD
endif
endif

ifeq ($(ENABLE_NBGL_KEYPAD), 1)
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX))
DEFINES += NBGL_KEYPAD
endif
endif

#####################################################################
Expand Down
51 changes: 13 additions & 38 deletions lib_nbgl/include/nbgl_use_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@ void nbgl_useCaseGenericConfiguration(const char *title,
const nbgl_genericContents_t *contents,
nbgl_callback_t quitCallback);

void nbgl_useCaseChoice(const nbgl_icon_details_t *icon,
const char *message,
const char *subMessage,
const char *confirmText,
const char *rejectString,
nbgl_choiceCallback_t callback);

void nbgl_useCaseStatus(const char *message, bool isSuccess, nbgl_callback_t quitCallback);

void nbgl_useCaseSpinner(const char *text);

#ifdef HAVE_SE_TOUCH
// utils
uint8_t nbgl_useCaseGetNbTagValuesInPage(uint8_t nbPairs,
Expand Down Expand Up @@ -278,18 +289,11 @@ void nbgl_useCaseGenericSettings(const char *appName,
const nbgl_genericContents_t *settingContents,
const nbgl_contentInfoList_t *infosList,
nbgl_callback_t quitCallback);
void nbgl_useCaseChoice(const nbgl_icon_details_t *icon,
const char *message,
const char *subMessage,
const char *confirmText,
const char *rejectString,
nbgl_choiceCallback_t callback);
void nbgl_useCaseConfirm(const char *message,
const char *subMessage,
const char *confirmText,
const char *rejectText,
nbgl_callback_t callback);
void nbgl_useCaseStatus(const char *message, bool isSuccess, nbgl_callback_t quitCallback);
void nbgl_useCaseReviewStart(const nbgl_icon_details_t *icon,
const char *reviewTitle,
const char *reviewSubTitle,
Expand Down Expand Up @@ -362,38 +366,9 @@ DEPRECATED static inline void nbgl_useCaseKeypad(const char *titl
validatePinCallback,
actionCallback);
}
#endif
#else // HAVE_SE_TOUCH
void nbgl_useCaseHome(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *appVersion,
const char *tagline,
nbgl_callback_t aboutCallback,
nbgl_callback_t quitCallback);
void nbgl_useCaseSettings(uint8_t initPage,
uint8_t nbPages,
nbgl_callback_t quitCallback,
nbgl_navCallback_t navCallback,
nbgl_actionCallback_t actionCallback);
void nbgl_useCaseRegularReview(uint8_t initPage, uint8_t nbPages, nbgl_navCallback_t navCallback);
void nbgl_useCaseForwardOnlyReview(nbgl_navCallback_t navCallback);
void nbgl_useCaseStaticReview(nbgl_contentTagValueList_t *tagValueList,
const nbgl_icon_details_t *icon,
const char *reviewTitle,
const char *acceptText,
const char *rejectText,
nbgl_choiceCallback_t callback);
void nbgl_useCaseAddressConfirmation(const nbgl_icon_details_t *icon,
const char *title,
const char *address,
nbgl_choiceCallback_t callback);
void nbgl_useCaseAddressConfirmationExt(const nbgl_icon_details_t *icon,
const char *title,
const char *address,
nbgl_choiceCallback_t callback,
const nbgl_contentTagValueList_t *tagValueList);
#endif // NBGL_KEYPAD
#endif // HAVE_SE_TOUCH
void nbgl_useCaseSpinner(const char *text);

#ifdef __cplusplus
} /* extern "C" */
#endif
Expand Down
Loading

0 comments on commit b543f83

Please sign in to comment.