diff --git a/io/include/os_io_seph_ux.h b/io/include/os_io_seph_ux.h index 7f32647c3..f8424010e 100644 --- a/io/include/os_io_seph_ux.h +++ b/io/include/os_io_seph_ux.h @@ -3,7 +3,7 @@ #pragma once /* Includes ------------------------------------------------------------------*/ -#include "ux.h" +#include "decorators.h" #ifdef HAVE_BAGL #include "ux_bagl.h" @@ -30,7 +30,7 @@ typedef enum { } os_io_touch_debug_mode_t; /* Exported types, structures, unions ----------------------------------------*/ -#ifdef HAVE_SE_TOUCH + typedef struct io_touch_info_s { uint16_t x; uint16_t y; @@ -39,7 +39,6 @@ typedef struct io_touch_info_s { uint8_t h; uint8_t swipe; } io_touch_info_t; -#endif // HAVE_SE_TOUCH /* Exported defines --------------------------------------------------------*/ #define SERIALIZED_NBGL_MAX_LEN (100) @@ -49,10 +48,9 @@ typedef struct io_touch_info_s { /* Exported variables --------------------------------------------------------*/ /* Exported functions prototypes--------------------------------------------- */ -void io_seph_ux_init_button(void); -void io_process_itc_ux_event(uint8_t *buffer_in, size_t buffer_in_length); -void io_process_event(uint8_t *buffer_in, size_t buffer_in_length); -unsigned int os_ux_blocking(bolos_ux_params_t *params); +void io_seph_ux_init_button(void); +void io_process_itc_ux_event(uint8_t *buffer_in, size_t buffer_in_length); +void io_process_event(uint8_t *buffer_in, size_t buffer_in_length); #ifdef HAVE_BAGL void io_seph_ux_display_bagl_element(const bagl_element_t *element); diff --git a/io/src/os_io_seph_cmd.c b/io/src/os_io_seph_cmd.c index 47370ec8b..4125262e3 100644 --- a/io/src/os_io_seph_cmd.c +++ b/io/src/os_io_seph_cmd.c @@ -197,7 +197,7 @@ int os_io_seph_cmd_set_touch_state(uint8_t enable) buffer[0] = SEPROXYHAL_TAG_SET_TOUCH_STATE; buffer[1] = 0; buffer[2] = 1; - buffer[3] = (enable ? 0x00 : 0x01); + buffer[3] = (enable ? 0x01 : 0x00); return os_io_tx_cmd(OS_IO_PACKET_TYPE_SEPH, buffer, 4, NULL); } diff --git a/lib_blewbxx/src/ble_ledger.c b/lib_blewbxx/src/ble_ledger.c index ef85913cb..4343e4dc7 100644 --- a/lib_blewbxx/src/ble_ledger.c +++ b/lib_blewbxx/src/ble_ledger.c @@ -177,7 +177,6 @@ static void init_mngr(uint8_t *hci_buffer, uint16_t length) } } - ble_ledger_data.init_step++; switch (ble_ledger_data.init_step) { diff --git a/lib_blewbxx/src/ble_ledger_profile_apdu.c b/lib_blewbxx/src/ble_ledger_profile_apdu.c index b68fe3a21..ac490dde0 100644 --- a/lib_blewbxx/src/ble_ledger_profile_apdu.c +++ b/lib_blewbxx/src/ble_ledger_profile_apdu.c @@ -11,7 +11,7 @@ #ifdef HAVE_PRINTF #define DEBUG PRINTF -//#define DEBUG(...) +// #define DEBUG(...) #else // !HAVE_PRINTF #define DEBUG(...) #endif // !HAVE_PRINTF diff --git a/lib_cxng/src/cx_rng.h b/lib_cxng/src/cx_rng.h index 611c4a31a..fe45fe6bd 100644 --- a/lib_cxng/src/cx_rng.h +++ b/lib_cxng/src/cx_rng.h @@ -19,6 +19,10 @@ #ifndef CX_RNG_H #define CX_RNG_H +#ifdef BOLOS_OS_UPGRADER_APP +#include "osu_defines.h" +#endif + #ifdef HAVE_RNG #include diff --git a/lib_nbgl/src/nbgl_layout.c b/lib_nbgl/src/nbgl_layout.c index a09c78952..4ab20e9f5 100644 --- a/lib_nbgl/src/nbgl_layout.c +++ b/lib_nbgl/src/nbgl_layout.c @@ -122,7 +122,7 @@ static uint8_t nbTouchableControls = 0; /********************** * STATIC PROTOTYPES **********************/ -extern const char *get_ux_loc_string(UX_LOC_STRINGS_INDEX index); +// extern const char *get_ux_loc_string(UX_LOC_STRINGS_INDEX index); #ifdef HAVE_FAST_HOLD_TO_APPROVE // Unit step in % of touchable progress bar diff --git a/lib_nbgl/src/nbgl_obj.c b/lib_nbgl/src/nbgl_obj.c index 8e071a022..0ced351ea 100644 --- a/lib_nbgl/src/nbgl_obj.c +++ b/lib_nbgl/src/nbgl_obj.c @@ -18,6 +18,7 @@ #include "os_helpers.h" #include "os_pic.h" #include "glyphs.h" +#include "os_io_seph_ux.h" #ifdef HAVE_SERIALIZED_NBGL #include "nbgl_serialize.h" #endif @@ -134,7 +135,6 @@ extern bool last_bold_state, verbose; /********************** * STATIC PROTOTYPES **********************/ -extern const char *get_ux_loc_string(UX_LOC_STRINGS_INDEX index); /********************** * GLOBAL FUNCTIONS @@ -1408,7 +1408,7 @@ static void draw_object(nbgl_obj_t *obj, nbgl_obj_t *prevObj, bool computePositi } #ifdef HAVE_SERIALIZED_NBGL - io_seproxyhal_send_nbgl_serialized(NBGL_DRAW_OBJ, obj); + io_seph_ux_send_nbgl_serialized(NBGL_DRAW_OBJ, obj); #endif if (!objRefreshAreaDone) { extendRefreshArea(&obj->area); @@ -1617,7 +1617,7 @@ bool nbgl_refreshIsNeeded(void) void nbgl_refreshReset(void) { #ifdef HAVE_SERIALIZED_NBGL - io_seproxyhal_send_nbgl_serialized(NBGL_REFRESH_AREA, (nbgl_obj_t *) &refreshArea); + io_seph_ux_send_nbgl_serialized(NBGL_REFRESH_AREA, (nbgl_obj_t *) &refreshArea); #endif refreshArea.x0 = SCREEN_WIDTH - 1; refreshArea.width = 0; diff --git a/lib_stusb/src/usbd_ledger.c b/lib_stusb/src/usbd_ledger.c index aa5c18188..7d863bd4e 100644 --- a/lib_stusb/src/usbd_ledger.c +++ b/lib_stusb/src/usbd_ledger.c @@ -12,6 +12,7 @@ #include "usbd_ledger_cdc.h" #include "os_io_seph_cmd.h" #include "seproxyhal_protocol.h" +#include "hal_timers.h" #pragma GCC diagnostic ignored "-Wcast-qual" @@ -474,6 +475,7 @@ void USBD_LEDGER_start(uint16_t pid, uint16_t vid, char *name, uint16_t class_ma USBD_Init(&usbd_ledger_data.usbd_handle, (USBD_DescriptorsTypeDef *) &LEDGER_Desc, 0); USBD_RegisterClass(&usbd_ledger_data.usbd_handle, (USBD_ClassTypeDef *) &USBD_LEDGER_CLASS); USBD_Start(&usbd_ledger_data.usbd_handle); + os_delay_ms(400); usbd_ledger_data.classes = class_mask; } } diff --git a/lib_u2f/src/u2f_transport.c b/lib_u2f/src/u2f_transport.c index 9a6578959..194e4d2e2 100644 --- a/lib_u2f/src/u2f_transport.c +++ b/lib_u2f/src/u2f_transport.c @@ -88,7 +88,7 @@ static u2f_error_t process_packet(u2f_transport_t *handle, uint8_t *buffer, uint goto end; } - // Check packet will fit in the rx buffer + // Check if packet will fit in the rx buffer handle->rx_message_length = (uint16_t) U2BE(buffer, 1) + 3; if (handle->rx_message_length > handle->rx_message_buffer_size) { error = CTAP1_ERR_OTHER; diff --git a/lib_ux_nbgl/ux_nbgl.h b/lib_ux_nbgl/ux_nbgl.h index 1e4ec092c..a9037f928 100644 --- a/lib_ux_nbgl/ux_nbgl.h +++ b/lib_ux_nbgl/ux_nbgl.h @@ -27,11 +27,12 @@ #include "os_task.h" #include "nbgl_screen.h" #include "nbgl_touch.h" +#include "seproxyhal_protocol.h" #include -#define BUTTON_LEFT 1 -#define BUTTON_RIGHT 2 +#define BUTTON_LEFT SEPROXYHAL_TAG_BUTTON_PUSH_EVENT_LEFT +#define BUTTON_RIGHT SEPROXYHAL_TAG_BUTTON_PUSH_EVENT_RIGHT /** * Common structure for applications to perform asynchronous UX aside IO operations