diff --git a/src/handle_get_pubkey.c b/src/handle_get_pubkey.c index 407b2e5f..f61395e7 100644 --- a/src/handle_get_pubkey.c +++ b/src/handle_get_pubkey.c @@ -2,6 +2,7 @@ #include "globals.h" #include "handle_get_pubkey.h" #include "sol/printer.h" +#include "ui_api.h" static uint8_t G_publicKey[PUBKEY_LENGTH]; char G_publicKeyStr[BASE58_PUBKEY_LENGTH]; diff --git a/src/handle_get_pubkey.h b/src/handle_get_pubkey.h index 6792afe1..99ade210 100644 --- a/src/handle_get_pubkey.h +++ b/src/handle_get_pubkey.h @@ -12,5 +12,3 @@ void reset_getpubkey_globals(void); void handle_get_pubkey(volatile unsigned int *flags, volatile unsigned int *tx); uint8_t set_result_get_pubkey(void); - -void ui_get_public_key(void); diff --git a/src/handle_sign_message.c b/src/handle_sign_message.c index 6beea1ce..dbabeed5 100644 --- a/src/handle_sign_message.c +++ b/src/handle_sign_message.c @@ -1,5 +1,4 @@ #include "io.h" -#include "menu.h" #include "utils.h" #include "handle_swap_sign_transaction.h" @@ -10,6 +9,7 @@ #include "sol/transaction_summary.h" #include "handle_sign_message.h" +#include "ui_api.h" static int scan_header_for_signer(const uint32_t *derivation_path, uint32_t derivation_path_length, diff --git a/src/handle_sign_message.h b/src/handle_sign_message.h index 53ea87bb..57618bb3 100644 --- a/src/handle_sign_message.h +++ b/src/handle_sign_message.h @@ -3,5 +3,3 @@ void handle_sign_message_parse_message(volatile unsigned int *tx); void handle_sign_message_ui(volatile unsigned int *flags); - -void start_sign_tx_ui(size_t num_summary_steps); diff --git a/src/handle_sign_offchain_message.c b/src/handle_sign_offchain_message.c index 2a84e99d..1b5a725d 100644 --- a/src/handle_sign_offchain_message.c +++ b/src/handle_sign_offchain_message.c @@ -2,7 +2,6 @@ #include "os.h" #include "ux.h" #include "cx.h" -#include "menu.h" #include "utils.h" #include "sol/parser.h" #include "sol/printer.h" @@ -12,7 +11,7 @@ #include "globals.h" #include "apdu.h" #include "handle_sign_offchain_message.h" - +#include "ui_api.h" // Store locally the derived public key content static Pubkey G_publicKey; diff --git a/src/handle_sign_offchain_message.h b/src/handle_sign_offchain_message.h index 28a35217..11843430 100644 --- a/src/handle_sign_offchain_message.h +++ b/src/handle_sign_offchain_message.h @@ -5,5 +5,3 @@ #include "globals.h" void handle_sign_offchain_message(volatile unsigned int *flags, volatile unsigned int *tx); - -void start_sign_offchain_message_ui(bool is_ascii, size_t num_summary_steps); diff --git a/src/io.c b/src/io.c index c222e9ae..c3025dff 100644 --- a/src/io.c +++ b/src/io.c @@ -22,12 +22,12 @@ #include "ux.h" #include "apdu.h" -#include "menu.h" +#include "ui_api.h" #include "io.h" // override point, but nothing more to do void io_seproxyhal_display(const bagl_element_t *element) { - io_seproxyhal_display_default((bagl_element_t *) element); + io_seproxyhal_display_default(element); } uint8_t io_event(uint8_t channel) { diff --git a/src/main.c b/src/main.c index 4bdecb27..7bc84e90 100644 --- a/src/main.c +++ b/src/main.c @@ -20,7 +20,7 @@ #include "handle_sign_message.h" #include "handle_sign_offchain_message.h" #include "apdu.h" -#include "menu.h" +#include "ui_api.h" // Swap feature #include "swap_lib_calls.h" diff --git a/src/menu.h b/src/menu.h deleted file mode 100644 index 3c1498cb..00000000 --- a/src/menu.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include "globals.h" -#include "glyphs.h" - -void ui_idle(void); diff --git a/src/ui/menu_bagl.c b/src/ui/menu_bagl.c index 5f979815..45e32b63 100644 --- a/src/ui/menu_bagl.c +++ b/src/ui/menu_bagl.c @@ -1,8 +1,10 @@ #ifdef HAVE_BAGL -#include "menu.h" +#include "ux.h" #include "os.h" +#include "globals.h" #include "glyphs.h" +#include "ui_api.h" void display_settings(void); void switch_allow_blind_sign_data(void); diff --git a/src/ui/ui_api.h b/src/ui/ui_api.h new file mode 100644 index 00000000..0c5cc054 --- /dev/null +++ b/src/ui/ui_api.h @@ -0,0 +1,11 @@ +#pragma once + +#include "os.h" + +void ui_idle(void); + +void ui_get_public_key(void); + +void start_sign_tx_ui(size_t num_summary_steps); + +void start_sign_offchain_message_ui(bool is_ascii, size_t num_summary_steps); diff --git a/src/utils.c b/src/utils.c index 57156e97..a1696bdf 100644 --- a/src/utils.c +++ b/src/utils.c @@ -3,7 +3,6 @@ #include #include #include "utils.h" -#include "menu.h" void get_public_key(uint8_t *publicKeyArray, const uint32_t *derivationPath, size_t pathLength) { cx_ecfp_private_key_t privateKey;