Skip to content

Commit

Permalink
Merge pull request #26 from LedgerHQ/fbe/flex_support (B2CA-1689)
Browse files Browse the repository at this point in the history
Fbe/flex support
  • Loading branch information
tdejoigny-ledger authored Jul 20, 2024
2 parents 6e7ce1e + ca5b31f commit b7cffc7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 1,399 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Release build

on:
workflow_dispatch:
push:
branches:
- main
- master
- develop
pull_request:

jobs:
build:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: "compiled_app_bindaries"
151 changes: 5 additions & 146 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,152 +15,11 @@
# limitations under the License.
#*******************************************************************************

ifeq ($(BOLOS_SDK),)
$(error Environment variable BOLOS_SDK is not set)
endif

include $(BOLOS_SDK)/Makefile.defines

APP_LOAD_PARAMS += --appFlags 0x800 --path "44'/60'" --path "45'" --curve secp256k1
APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)

APPVERSION_M = 2
APPVERSION_N = 1
APPVERSION_P = 1
APPVERSION = $(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)

APPNAME = "Paraswap"

#prepare hsm generation
ifeq ($(TARGET_NAME), TARGET_NANOS)
ICONNAME=icons/nanos_app_paraswap.gif
else ifeq ($(TARGET_NAME), TARGET_STAX)
ICONNAME=icons/stax_app_paraswap.gif
DEFINES += ICONGLYPH=C_stax_paraswap_64px
DEFINES += ICONBITMAP=C_stax_paraswap_64px_bitmap
GLYPH_FILES += $(ICONNAME)
else
ICONNAME=icons/nanox_app_paraswap.gif
endif

################
# Default rule #
################
all: default

############
# Platform #
############

DEFINES += OS_IO_SEPROXYHAL
DEFINES += HAVE_SPRINTF
DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P)
DEFINES += IO_HID_EP_LENGTH=64

DEFINES += UNUSED\(x\)=\(void\)x
DEFINES += APPVERSION=\"$(APPVERSION)\"
CFLAGS += -DAPPNAME=\"$(APPNAME)\"

ifneq (,$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000
DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE
endif

ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128
else
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300
endif

ifneq ($(TARGET_NAME),TARGET_STAX)
DEFINES += HAVE_BAGL
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
endif
endif

# Enabling debug PRINTF
ifneq ($(DEBUG),0)
DEFINES += HAVE_STACK_OVERFLOW_CHECK
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl
DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=64 HAVE_USB_APDU

ifeq ($(DEBUG),10)
$(warning Using semihosted PRINTF. Only run with speculos!)
CFLAGS += -include src/dbg/debug.h
DEFINES += HAVE_PRINTF PRINTF=semihosted_printf
else
ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += HAVE_PRINTF PRINTF=screen_printf
else
DEFINES += HAVE_PRINTF PRINTF=mcu_usb_printf
endif

endif
else
DEFINES += PRINTF\(...\)=
endif

##############
# Compiler #
##############
ifneq ($(BOLOS_ENV),)
$(info BOLOS_ENV=$(BOLOS_ENV))
CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/
GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/
else
$(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH)
endif
ifeq ($(CLANGPATH),)
$(info CLANGPATH is not set: clang will be used from PATH)
endif
ifeq ($(GCCPATH),)
$(info GCCPATH is not set: arm-none-eabi-* will be used from PATH)
endif

CC := $(CLANGPATH)clang

AS := $(GCCPATH)arm-none-eabi-gcc

LD := $(GCCPATH)arm-none-eabi-gcc
LDLIBS += -lm -lgcc -lc

# import rules to compile glyphs(/pone)
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 ethereum-plugin-sdk
ifneq ($(TARGET_NAME), TARGET_STAX)
SDK_SOURCE_PATH += lib_ux
endif
ifneq (,$(findstring HAVE_BLE,$(DEFINES)))
SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl
endif

### initialize plugin SDK submodule if needed
ifneq ($(shell git submodule status | grep '^[-+]'),)
$(info INFO: Need to reinitialize git submodules)
$(shell git submodule update --init)
endif

load: all
python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS)

delete:
python3 -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS)

# import generic rules from the sdk
include $(BOLOS_SDK)/Makefile.rules


#add dependency on custom makefile filename
dep/%.d: %.c Makefile
# Application version
APPVERSION_M = 2
APPVERSION_N = 1
APPVERSION_P = 1

listvariants:
@echo VARIANTS NONE paraswap
include ethereum-plugin-sdk/standard_plugin.mk
Binary file added icons/flex_app_paraswap.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ledger_app.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos", "nanox", "nanos+", "stax"]
devices = ["nanos", "nanox", "nanos+", "stax", "flex"]
68 changes: 0 additions & 68 deletions src/dbg/debug.c

This file was deleted.

6 changes: 0 additions & 6 deletions src/dbg/debug.h

This file was deleted.

Loading

0 comments on commit b7cffc7

Please sign in to comment.