Skip to content

Commit

Permalink
Icon & name are now passed to the Ethereum app; Updated plugin SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
cbouvet-ledger authored and apaillier-ledger committed May 16, 2023
1 parent c600fab commit 585e921
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

ifeq ($(TARGET_NAME), TARGET_NANOS)
ICONNAME=icons/nanos_app_kiln.gif
else ifeq ($(TARGET_NAME), TARGET_STAX)
ICONNAME=icons/stax_app_kiln.gif
DEFINES += ICONGLYPH=C_stax_kiln_64px
DEFINES += ICONBITMAP=C_stax_kiln_64px_bitmap
GLYPH_FILES += $(ICONNAME)
else
ICONNAME=icons/nanox_app_kiln.gif
endif
Expand Down
2 changes: 1 addition & 1 deletion ethereum-plugin-sdk
Binary file added glyphs/stax_kiln_64px.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/stax_app_kiln.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "os.h"
#include "cx.h"
#include "glyphs.h"

#include "kiln_plugin.h"

Expand Down Expand Up @@ -60,10 +61,27 @@ void handle_query_ui_exception(unsigned int *args) {

// Calls the ethereum app.
void call_app_ethereum() {
unsigned int libcall_params[3];
unsigned int libcall_params[5];

libcall_params[0] = (unsigned int) "Ethereum";
libcall_params[1] = 0x100;
libcall_params[2] = RUN_APPLICATION;
libcall_params[3] = (unsigned int) NULL;
#ifdef HAVE_NBGL
caller_app_t capp;
const char name[] = APPNAME;
nbgl_icon_details_t icon_details;
uint8_t bitmap[sizeof(ICONBITMAP)];

memcpy(&icon_details, &ICONGLYPH, sizeof(ICONGLYPH));
memcpy(&bitmap, &ICONBITMAP, sizeof(bitmap));
icon_details.bitmap = (const uint8_t *) bitmap;
capp.name = name;
capp.icon = &icon_details;
libcall_params[4] = (unsigned int) &capp;
#else
libcall_params[4] = (unsigned int) NULL;
#endif
os_lib_call((unsigned int *) &libcall_params);
}

Expand Down

0 comments on commit 585e921

Please sign in to comment.