Skip to content

Commit

Permalink
Merge pull request #120 from Zondax/fixes
Browse files Browse the repository at this point in the history
upgrade dependencies
  • Loading branch information
jleni authored Aug 27, 2021
2 parents 77fce8d + 20452e5 commit e8f37a8
Show file tree
Hide file tree
Showing 16 changed files with 364 additions and 311 deletions.
10 changes: 5 additions & 5 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ifndef COIN
COIN=ICP
endif

APPVERSION_M=10
APPVERSION_M=1
APPVERSION_N=0
APPVERSION_P=0

Expand Down Expand Up @@ -82,16 +82,16 @@ APP_LOAD_PARAMS = --appFlags 0x200 --delete $(COMMON_LOAD_PARAMS) --path ${APPPA
DEFINES += HAVE_PENDING_REVIEW_SCREEN

ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_STACK_SIZE:=1892
APP_STACK_SIZE:=2500
ICONNAME:=$(CURDIR)/nanos_icon.gif
OUTPUT_ELF ?= $(CURDIR)/output/app_s.elf
OUTPUT_INSTALLER := $(CURDIR)/pkg/installer_s.sh
DEFINES += CBOR_PARSER_MAX_RECURSIONS=4
endif

ifeq ($(TARGET_NAME),TARGET_NANOX)
ICONNAME:=$(CURDIR)/nanox_icon.gif
SCRIPT_LD:=$(CURDIR)/script_x.ld
ICONNAME:=$(CURDIR)/nanox_icon.gif
OUTPUT_ELF ?= $(CURDIR)/output/app_x.elf
OUTPUT_INSTALLER:= $(CURDIR)/pkg/installer_x.sh
DEFINES += CBOR_PARSER_MAX_RECURSIONS=16
Expand Down Expand Up @@ -173,7 +173,7 @@ endif
#########################

CC := $(CLANGPATH)clang
CFLAGS += -O3 -Os -Wno-unknown-pragmas -Wno-implicit-fallthrough
CFLAGS += -O3 -Os -Wno-unknown-pragmas -Wvla -Wno-implicit-fallthrough

AS := $(GCCPATH)arm-none-eabi-gcc
AFLAGS +=
Expand All @@ -188,12 +188,12 @@ GLYPH_SRC_DIR = glyphs
INCLUDES_PATH += $(MY_DIR)/glyphs
include $(BOLOS_SDK)/Makefile.glyphs

APP_SOURCE_PATH += $(MY_DIR)/../deps/picohash/
APP_SOURCE_PATH += $(MY_DIR)/src
APP_SOURCE_PATH += $(MY_DIR)/glyphs
APP_SOURCE_PATH += $(MY_DIR)/../deps/ledger-zxlib/include
APP_SOURCE_PATH += $(MY_DIR)/../deps/ledger-zxlib/src
APP_SOURCE_PATH += $(MY_DIR)/../deps/ledger-zxlib/app/common
APP_SOURCE_PATH += $(MY_DIR)/../deps/picohash/

SDK_SOURCE_PATH += lib_stusb lib_stusb_impl
SDK_SOURCE_PATH += lib_ux
Expand Down
5 changes: 4 additions & 1 deletion deps/ledger-zxlib/app/common/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ zxerr_t h_review_update_data() {
if (viewdata.pageCount > 1) {
uint8_t keyLen = strlen(viewdata.key);
if (keyLen < MAX_CHARS_PER_KEY_LINE) {
snprintf(viewdata.key + keyLen, MAX_CHARS_PER_KEY_LINE - keyLen, "[%d/%d]", viewdata.pageIdx + 1,
snprintf(viewdata.key + keyLen,
MAX_CHARS_PER_KEY_LINE - keyLen,
"[%d/%d]",
viewdata.pageIdx + 1,
viewdata.pageCount);
}
}
Expand Down
2 changes: 1 addition & 1 deletion deps/ledger-zxlib/dockerized_build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $(info EXAMPLE_VUE_DIR : $(EXAMPLE_VUE_DIR))
$(info TESTS_JS_DIR : $(TESTS_JS_DIR))
$(info TESTS_JS_PACKAGE : $(TESTS_JS_PACKAGE))

DOCKER_IMAGE=zondax/builder-bolos:e7a7395770addca0583dc7401a7284b805b41149
DOCKER_IMAGE=zondax/builder-bolos:latest

ifdef INTERACTIVE
INTERACTIVE_SETTING:="-i"
Expand Down
1 change: 1 addition & 0 deletions deps/ledger-zxlib/include/zxerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
********************************************************************************/

#pragma once
#include "zxmacros.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 2 additions & 0 deletions deps/ledger-zxlib/include/zxformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ extern "C" {
return NULL; \
}

NUM_TO_STR(int32)

NUM_TO_STR(int64)

NUM_TO_STR(uint64)
Expand Down
6 changes: 3 additions & 3 deletions deps/ledger-zxlib/include/zxmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ void zemu_log_stack(const char *ctx);

__Z_INLINE void zemu_log(const char *buf)
{
#if defined(ZEMU_LOGGING)
#if defined (TARGET_NANOS) || defined(TARGET_NANOX)
#if defined(ZEMU_LOGGING) && (defined (TARGET_NANOS) || defined(TARGET_NANOX))
asm volatile (
"movs r0, #0x04\n"
"movs r1, %0\n"
"svc 0xab\n"
:: "r"(buf) : "r0", "r1"
);
#endif
#else
UNUSED(buf);
#endif
}

Expand Down
22 changes: 8 additions & 14 deletions deps/ledger-zxlib/include/zxmacros_ledger.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,25 @@

#define MEMCPY_NV nvm_write

// This macros are kept for backwards compatibility
// the most recent SDK has unified implementations and deprecated the original os_***
#define MEMCPY memmove
#define MEMMOVE memmove
#define MEMSET memset
#define MEMCMP memcmp
#define MEMZERO explicit_bzero

#if defined(TARGET_NANOX)
#include "ux.h"
#define NV_CONST const
#define NV_VOLATILE volatile
#define IS_UX_ALLOWED (G_ux_params.len != BOLOS_UX_IGNORE && G_ux_params.len != BOLOS_UX_CONTINUE)

#define MEMMOVE os_memmove
#define MEMSET os_memset
#define MEMCPY os_memcpy
#define MEMCMP os_memcmp
#define MEMZERO explicit_bzero
#else
#include "ux.h"
#include "os_io_seproxyhal.h"
#define NV_CONST
#define NV_VOLATILE
#define IS_UX_ALLOWED (G_ux_params.len != BOLOS_UX_IGNORE && G_ux_params.len != BOLOS_UX_CONTINUE)

#define MEMCPY memmove
#define MEMMOVE memmove
#define MEMSET memset
#define MEMCMP memcmp
#define MEMZERO explicit_bzero

#endif

#define CHECK_APP_CANARY() check_app_canary();
Expand All @@ -59,5 +54,4 @@ extern unsigned int app_stack_canary;
WAIT_EVENT(); \
io_seproxyhal_general_status(); \
WAIT_EVENT()

#endif
2 changes: 2 additions & 0 deletions deps/ledger-zxlib/include/zxmacros_x64.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#if !defined (TARGET_NANOS) && !defined(TARGET_NANOX)

// This macros are kept for backwards compatibility
// the most recent SDK has unified implementations and deprecated the original os_***
#define MEMMOVE memmove
#define MEMSET memset
#define MEMCPY memcpy
Expand Down
4 changes: 2 additions & 2 deletions deps/ledger-zxlib/include/zxversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
********************************************************************************/
#pragma once

#define ZXLIB_MAJOR 8
#define ZXLIB_MINOR 0
#define ZXLIB_MAJOR 9
#define ZXLIB_MINOR 1
#define ZXLIB_PATCH 0
3 changes: 3 additions & 0 deletions deps/ledger-zxlib/src/zxmacros.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@ void zemu_trace(const char *file, uint32_t line) {
char buf[200];
snprintf(buf, sizeof(buf), "|TRACE| %s:%d\n", file, line);
zemu_log(buf);
#else
UNUSED(file);
UNUSED(line);
#endif
}
Binary file modified tests_zemu/snapshots/s-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-mainmenu/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/x-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/x-mainmenu/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e8f37a8

Please sign in to comment.