diff --git a/src/globals.c b/src/globals.c index e8d7cc0..07703f1 100644 --- a/src/globals.c +++ b/src/globals.c @@ -2,8 +2,8 @@ #include "os.h" #include "ux.h" -ux_state_t G_ux; -bolos_ux_params_t G_ux_params; +// ux_state_t G_ux; +// bolos_ux_params_t G_ux_params; // display stepped screens unsigned int ux_step; diff --git a/src/handler/get_app_configuration.c b/src/handler/get_app_configuration.c index a6fb31d..440905b 100644 --- a/src/handler/get_app_configuration.c +++ b/src/handler/get_app_configuration.c @@ -10,9 +10,11 @@ void handleGetAppConfiguration(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint UNUSED(flags); VALIDATE(p1 == 0 && p2 == 0 && dataLength == 0, ERR_INVALID_REQUEST); - G_io_apdu_buffer[0] = LEDGER_MAJOR_VERSION; - G_io_apdu_buffer[1] = LEDGER_MINOR_VERSION; - G_io_apdu_buffer[2] = LEDGER_PATCH_VERSION; + G_io_apdu_buffer[0] = MAJOR_VERSION; + G_io_apdu_buffer[1] = MINOR_VERSION; + G_io_apdu_buffer[2] = PATCH_VERSION; *tx = 3; THROW(SUCCESS); + + } diff --git a/src/main.c b/src/main.c index 86fb937..e7a373c 100644 --- a/src/main.c +++ b/src/main.c @@ -19,7 +19,7 @@ #include "menu.h" #include "apdu_constants.h" -unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; +// unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; BocContext_t boc_context; DataContext_t data_context; @@ -164,10 +164,10 @@ void app_main(void) { return; } -// override point, but nothing more to do -void io_seproxyhal_display(const bagl_element_t *element) { - io_seproxyhal_display_default((bagl_element_t*)element); -} +// // override point, but nothing more to do +// void io_seproxyhal_display(const bagl_element_t *element) { +// io_seproxyhal_display_default((bagl_element_t*)element); +// } unsigned char io_event(unsigned char channel) { UNUSED(channel); diff --git a/src/ui/menu_nbgl.c b/src/ui/menu_nbgl.c index 7e5405b..d569931 100644 --- a/src/ui/menu_nbgl.c +++ b/src/ui/menu_nbgl.c @@ -1,6 +1,40 @@ #ifdef HAVE_NBGL #include "menu.h" +#include "os.h" +// ----------------------------------------------------------- +// --------------------- SETTINGS MENU ----------------------- +// ----------------------------------------------------------- +#define SETTING_INFO_NB 2 +static const char* const INFO_TYPES[SETTING_INFO_NB] = {"Version", "Developer"}; +static const char* const INFO_CONTENTS[SETTING_INFO_NB] = {APPVERSION, "Blooo"}; +static const nbgl_contentInfoList_t infoList = { + .nbInfos = SETTING_INFO_NB, + .infoTypes = INFO_TYPES, + .infoContents = INFO_CONTENTS, +}; + +// ----------------------------------------------------------- +// ----------------------- HOME PAGE ------------------------- +// ----------------------------------------------------------- + +void ui_main_menu(void) { + tx_state->currentInstruction = -1; + + nbgl_useCaseHomeAndSettings(APPNAME, + &C_app_everscale_64px, + NULL, + INIT_HOME_PAGE, + NULL, + &infoList, + NULL, + app_quit); +} + +void app_quit(void) { + // exit app here + os_sched_exit(-1); +} #endif \ No newline at end of file diff --git a/src/utils.c b/src/utils.c index 0bfccb1..091e909 100644 --- a/src/utils.c +++ b/src/utils.c @@ -78,21 +78,21 @@ void send_response(uint8_t tx, bool approve) { ui_main_menu(); } -unsigned int ui_prepro(const bagl_element_t *element) { - unsigned int display = 1; - if (element->component.userid > 0) { - display = (ux_step == element->component.userid - 1); - if (display) { - if (element->component.userid == 1) { - UX_CALLBACK_SET_INTERVAL(2000); - } - else { - UX_CALLBACK_SET_INTERVAL(MAX(3000, 1000 + bagl_label_roundtrip_duration_ms(element, 7))); - } - } - } - return display; -} +// unsigned int ui_prepro(const bagl_element_t *element) { +// unsigned int display = 1; +// if (element->component.userid > 0) { +// display = (ux_step == element->component.userid - 1); +// if (display) { +// if (element->component.userid == 1) { +// UX_CALLBACK_SET_INTERVAL(2000); +// } +// else { +// UX_CALLBACK_SET_INTERVAL(MAX(3000, 1000 + bagl_label_roundtrip_duration_ms(element, 7))); +// } +// } +// } +// return display; +// } void writeUint32BE(uint32_t val, uint8_t *bytes) { bytes[0] = (val >> 24) & 0xFF; diff --git a/src/utils.h b/src/utils.h index 8a131ff..ef48763 100644 --- a/src/utils.h +++ b/src/utils.h @@ -4,15 +4,17 @@ #include "os.h" #include "cx.h" #include "globals.h" +#include "ux.h" #include #include -unsigned int ui_prepro(const bagl_element_t *element); +// unsigned int ui_prepro(const bagl_element_t *element); void get_public_key(uint32_t accountNumber, uint8_t* publicKeyArray); void get_private_key(uint32_t accountNumber, cx_ecfp_private_key_t *privateKey); void send_response(uint8_t tx, bool approve); + void writeUint32BE(uint32_t val, uint8_t *bytes); void writeUint64BE(uint64_t val, uint8_t *bytes);