plyugin test pass name
This commit is contained in:
@@ -174,7 +174,7 @@ DEFINES += HAVE_CAL_CI_KEY
|
||||
endif
|
||||
|
||||
# Enabling debug PRINTF
|
||||
DEBUG:=0
|
||||
DEBUG:=1
|
||||
ifneq ($(DEBUG),0)
|
||||
DEFINES += HAVE_STACK_OVERFLOW_CHECK
|
||||
ifeq ($(TARGET_NAME),TARGET_NANOS)
|
||||
|
||||
+17
-21
@@ -929,14 +929,22 @@ void init_coin_config(chain_config_t *coin_config) {
|
||||
coin_config->kind = CHAIN_KIND;
|
||||
}
|
||||
|
||||
void coin_main(chain_config_t *coin_config) {
|
||||
static char plugin_name[20] = { 0 };
|
||||
|
||||
void coin_main(libargs_t *args) {
|
||||
chain_config_t config;
|
||||
if (coin_config == NULL) {
|
||||
if (args) {
|
||||
if (args->plugin_name != NULL) {
|
||||
strcpy(plugin_name, args->plugin_name);
|
||||
}
|
||||
if (args->chain_config != NULL) {
|
||||
chainConfig = args->chain_config;
|
||||
}
|
||||
} else {
|
||||
init_coin_config(&config);
|
||||
chainConfig = &config;
|
||||
} else {
|
||||
chainConfig = coin_config;
|
||||
}
|
||||
|
||||
reset_app_context();
|
||||
tmpCtx.transactionContext.currentItemIndex = 0;
|
||||
|
||||
@@ -976,8 +984,7 @@ void coin_main(chain_config_t *coin_config) {
|
||||
USB_power(0);
|
||||
USB_power(1);
|
||||
|
||||
ui_idle();
|
||||
|
||||
ui_idle_with_subtext(plugin_name[0] ? plugin_name: NULL);
|
||||
#ifdef HAVE_BLE
|
||||
BLE_power(0, NULL);
|
||||
BLE_power(1, "Nano X");
|
||||
@@ -1002,18 +1009,7 @@ void coin_main(chain_config_t *coin_config) {
|
||||
app_exit();
|
||||
}
|
||||
|
||||
struct libargs_s {
|
||||
unsigned int id;
|
||||
unsigned int command;
|
||||
chain_config_t *chain_config;
|
||||
union {
|
||||
check_address_parameters_t *check_address;
|
||||
create_transaction_parameters_t *create_transaction;
|
||||
get_printable_amount_parameters_t *get_printable_amount;
|
||||
};
|
||||
};
|
||||
|
||||
static void library_main_helper(struct libargs_s *args) {
|
||||
static void library_main_helper(libargs_t *args) {
|
||||
check_api_level(CX_COMPAT_APILEVEL);
|
||||
PRINTF("Inside a library \n");
|
||||
switch (args->command) {
|
||||
@@ -1041,7 +1037,7 @@ static void library_main_helper(struct libargs_s *args) {
|
||||
}
|
||||
}
|
||||
|
||||
void library_main(struct libargs_s *args) {
|
||||
void library_main(libargs_t *args) {
|
||||
chain_config_t coin_config;
|
||||
if (args->chain_config == NULL) {
|
||||
init_coin_config(&coin_config);
|
||||
@@ -1112,7 +1108,7 @@ __attribute__((section(".boot"))) int main(int arg0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct libargs_s *args = (struct libargs_s *) arg0;
|
||||
libargs_t *args = (libargs_t *) arg0;
|
||||
if (args->id != 0x100) {
|
||||
app_exit();
|
||||
return 0;
|
||||
@@ -1120,7 +1116,7 @@ __attribute__((section(".boot"))) int main(int arg0) {
|
||||
switch (args->command) {
|
||||
case RUN_APPLICATION:
|
||||
// called as ethereum from altcoin or plugin
|
||||
coin_main(args->chain_config);
|
||||
coin_main(args);
|
||||
break;
|
||||
default:
|
||||
// called as ethereum or altcoin library
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define _SWAP_LIB_CALLS_H_
|
||||
|
||||
#include "stdbool.h"
|
||||
#include "chainConfig.h"
|
||||
|
||||
#define RUN_APPLICATION 1
|
||||
|
||||
@@ -52,4 +53,16 @@ typedef struct create_transaction_parameters_s {
|
||||
const char* const destination_address_extra_id;
|
||||
} create_transaction_parameters_t;
|
||||
|
||||
typedef struct libargs_s {
|
||||
unsigned int id;
|
||||
unsigned int command;
|
||||
chain_config_t *chain_config;
|
||||
union {
|
||||
check_address_parameters_t *check_address;
|
||||
create_transaction_parameters_t *create_transaction;
|
||||
get_printable_amount_parameters_t *get_printable_amount;
|
||||
char *plugin_name;
|
||||
};
|
||||
} libargs_t;
|
||||
|
||||
#endif // _SWAP_LIB_CALLS_H_
|
||||
|
||||
@@ -18,6 +18,10 @@ void app_quit(void) {
|
||||
os_sched_exit(-1);
|
||||
}
|
||||
|
||||
void ui_idle_with_subtext(char *test) {
|
||||
nbgl_useCaseHome(APPNAME, &ICONGLYPH, test, true, ui_menu_settings, app_quit);
|
||||
}
|
||||
|
||||
void ui_idle(void) {
|
||||
nbgl_useCaseHome(APPNAME, &ICONGLYPH, NULL, true, ui_menu_settings, app_quit);
|
||||
}
|
||||
Reference in New Issue
Block a user