Skip to content

Commit

Permalink
WIP10: osu
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Portron committed Oct 21, 2024
1 parent 09c952f commit e21ca22
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 17 deletions.
12 changes: 5 additions & 7 deletions io/include/os_io_seph_ux.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma once

/* Includes ------------------------------------------------------------------*/
#include "ux.h"
#include "decorators.h"

#ifdef HAVE_BAGL
#include "ux_bagl.h"
Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion io/src/os_io_seph_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion lib_blewbxx/src/ble_ledger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib_blewbxx/src/ble_ledger_profile_apdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#ifdef HAVE_PRINTF
#define DEBUG PRINTF
//#define DEBUG(...)
// #define DEBUG(...)
#else // !HAVE_PRINTF
#define DEBUG(...)
#endif // !HAVE_PRINTF
Expand Down
4 changes: 4 additions & 0 deletions lib_cxng/src/cx_rng.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/src/nbgl_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib_nbgl/src/nbgl_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions lib_stusb/src/usbd_ledger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib_u2f/src/u2f_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions lib_ux_nbgl/ux_nbgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
#include "os_task.h"
#include "nbgl_screen.h"
#include "nbgl_touch.h"
#include "seproxyhal_protocol.h"

#include <string.h>

#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
Expand Down

0 comments on commit e21ca22

Please sign in to comment.