Skip to content

Commit

Permalink
fix: build for lns+
Browse files Browse the repository at this point in the history
  • Loading branch information
Edouard Merle committed Feb 9, 2022
1 parent fb90551 commit 8be3c28
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ DEFINES += $(DEFINES_LIB)

ifeq ($(TARGET_NAME),TARGET_BLUE)
ICONNAME=blue_app_$(COIN).gif
else ifeq ($(TARGET_NAME),TARGET_NANOS)
ICONNAME=nanos_app_$(COIN).gif
else
ifeq ($(TARGET_NAME),TARGET_NANOX)
ICONNAME=nanox_app_$(COIN).gif
else
ICONNAME=nanos_app_$(COIN).gif
endif
endif

################
Expand Down Expand Up @@ -100,24 +98,26 @@ DEFINES += APPVERSION=\"$(APPVERSION)\"
ifeq ($(TARGET_NAME),TARGET_NANOX)
DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000
DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE
endif

ifneq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += HAVE_GLO096
DEFINES += HAVE_BAGL BAGL_WIDTH=128 BAGL_HEIGHT=64
DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature
DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX
DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX
DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX
DEFINES += HAVE_UX_FLOW
DEFINES += HAVE_UX_FLOW
endif

# Enabling debug PRINTF
DEBUG = 0
ifneq ($(DEBUG),0)

ifeq ($(TARGET_NAME),TARGET_NANOX)
DEFINES += HAVE_PRINTF PRINTF=mcu_usb_printf
else
ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += HAVE_PRINTF PRINTF=screen_printf
else
DEFINES += HAVE_PRINTF PRINTF=mcu_usb_printf
endif
else
DEFINES += PRINTF\(...\)=
Expand Down Expand Up @@ -159,10 +159,10 @@ include $(BOLOS_SDK)/Makefile.glyphs
### variables processed by the common makefile.rules of the SDK to grab source files and include dirs
APP_SOURCE_PATH += src
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_u2f qrcode
SDK_SOURCE_PATH += lib_ux

ifeq ($(TARGET_NAME),TARGET_NANOX)
SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl
SDK_SOURCE_PATH += lib_ux
endif

load: all
Expand Down
34 changes: 17 additions & 17 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ unsigned int io_seproxyhal_touch_settings(const bagl_element_t *e);
unsigned int io_seproxyhal_touch_exit(const bagl_element_t *e);
void ui_idle(void);

#ifdef TARGET_NANOX
#if defined(TARGET_NANOX) || defined(TARGET_NANOS2)
#include "ux.h"
ux_state_t G_ux;
bolos_ux_params_t G_ux_params;
#else // TARGET_NANOX
#else
ux_state_t ux;
#endif // TARGET_NANOX
#endif // TARGET_NANOX || TARGET_NANOS2

// display stepped screens
unsigned int ux_step;
Expand Down Expand Up @@ -1438,7 +1438,7 @@ void ui_transaction_p2sh_blue_init(void) {
#endif // #if defined(TARGET_BLUE)


#if defined(TARGET_NANOX)
#if defined(TARGET_NANOX) || defined(TARGET_NANOS2)

const char* settings_submenu_getter(unsigned int idx);
void settings_submenu_selector(unsigned int idx);
Expand Down Expand Up @@ -1902,7 +1902,7 @@ UX_FLOW(ux_request_change_path_approval_flow,
&ux_request_change_path_approval_flow_4_step
);

#endif // #if defined(TARGET_NANOX)
#endif // TARGET_NANOX || TARGET_NANOS2

void ui_idle(void) {
ux_step_count = 0;
Expand All @@ -1912,7 +1912,7 @@ void ui_idle(void) {
UX_DISPLAY(ui_idle_blue, ui_idle_blue_prepro);
#elif defined(TARGET_NANOS)
UX_MENU_DISPLAY(0, menu_main, NULL);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
// reserve a display stack slot if none yet
if(G_ux.stack_count == 0) {
ux_stack_push();
Expand Down Expand Up @@ -2359,9 +2359,9 @@ unsigned int btchip_bagl_confirm_full_output() {
ux_step = 0;
ux_step_count = 4;
UX_DISPLAY(ui_verify_nanos, ui_verify_prepro);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_confirm_full_flow, NULL);
#endif // TARGET_NANOX
#endif // TARGET_NANOX || TARGET_NANOS2
return 1;
}

Expand All @@ -2388,9 +2388,9 @@ unsigned int btchip_bagl_confirm_single_output() {
ux_step = 0;
ux_step_count = 3;
UX_DISPLAY(ui_verify_output_nanos, ui_verify_output_prepro);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_confirm_single_flow, NULL);
#endif // TARGET_NANOX
#endif // TARGET_NANOX || TARGET_NANOS2
return 1;
}

Expand All @@ -2405,7 +2405,7 @@ unsigned int btchip_bagl_finalize_tx() {
ux_step = 0;
ux_step_count = 2;
UX_DISPLAY(ui_finalize_nanos, ui_finalize_prepro);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_finalize_flow, NULL);
#endif // TARGET_NANOX
return 1;
Expand All @@ -2422,7 +2422,7 @@ void btchip_bagl_confirm_message_signature() {
ux_step = 0;
ux_step_count = 2;
UX_DISPLAY(ui_verify_message_signature_nanos, ui_verify_message_prepro);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_sign_flow, NULL);
#endif // TARGET_NANOX
}
Expand Down Expand Up @@ -2450,8 +2450,8 @@ void btchip_bagl_display_public_key(unsigned char* derivation_path) {
ux_step = is_derivation_path_unusual?0:4;
ux_step_count = 6;
UX_DISPLAY(ui_display_address_nanos, ui_display_address_nanos_prepro);
#elif defined(TARGET_NANOX)

#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, is_derivation_path_unusual?ux_display_public_with_warning_flow:ux_display_public_flow, NULL);
#endif // TARGET_NANOX
}
Expand All @@ -2464,7 +2464,7 @@ void btchip_bagl_display_token()
ux_step = 0;
ux_step_count = 1;
UX_DISPLAY(ui_display_token_nanos, NULL);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_display_token_flow, NULL);
#endif // #if TARGET_ID
}
Expand All @@ -2478,7 +2478,7 @@ void btchip_bagl_request_pubkey_approval()
ux_step = 0;
ux_step_count = 1;
UX_DISPLAY(ui_request_pubkey_approval_nanos, NULL);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_request_pubkey_approval_flow, NULL);
#endif // #if TARGET_ID
}
Expand All @@ -2493,7 +2493,7 @@ void btchip_bagl_request_change_path_approval(unsigned char* change_path)
ux_step = 0;
ux_step_count = 4;
UX_DISPLAY(ui_request_change_path_approval_nanos, ui_request_change_path_approval_nanos_prepro);
#elif defined(TARGET_NANOX)
#elif defined(TARGET_NANOX) || defined(TARGET_NANOS2)
ux_flow_init(0, ux_request_change_path_approval_flow, NULL);
#endif // #if TARGET_ID
}
Expand Down

0 comments on commit 8be3c28

Please sign in to comment.