Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
abonnaudet-ledger committed Jul 11, 2024
1 parent 3da2d9e commit e94a1a4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Makefile.defines
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ DBG_LVL = -g3
else
OPTI_LVL = -Oz
OPTI_ALVL = -Os # assembler does not handle -Oz, use -Os instead
DBG_LVL = -g0
endif

DBG_LVL = -g

CFLAGS += $(OPTI_LVL) $(DBG_LVL)
CFLAGS += -fomit-frame-pointer -momit-leaf-frame-pointer

Expand Down
6 changes: 6 additions & 0 deletions lib_ux_nbgl/ux.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ static bool ux_forward_event(bool ignoring_app_if_ux_busy)
G_ux_params.len = 0;
os_ux(&G_ux_params);
G_ux_params.len = os_sched_last_status(TASK_BOLOS_UX);

// G_ux_params.ux_id = BOLOS_UX_IO_RESET;
// G_ux_params.len = 0;
// os_ux(&G_ux_params);
// G_ux_params.len = os_sched_last_status(TASK_BOLOS_UX);

if (G_ux_params.len == BOLOS_UX_REDRAW) {
// enable drawing according to UX decision
nbgl_objAllowDrawing(true);
Expand Down
22 changes: 15 additions & 7 deletions src/os_io_seproxyhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,21 @@ static const unsigned char seph_io_mcu_protect[] = {

void io_seproxyhal_init(void)
{
#if !defined(HAVE_BOLOS) && !defined(BOLOS_OS_UPGRADER_APP)
// Warn UX layer of io reset to avoid unwanted pin lock
memset(&G_ux_params, 0, sizeof(G_ux_params));
G_ux_params.ux_id = BOLOS_UX_IO_RESET;

// If the app has just been booted from the UX, multiple os_ux calls may be necessary
// to ensure UX layer has take the BOLOS_UX_IO_RESET instruction into account.
for (volatile uint8_t i = 0; i < 2; i++) {
os_ux(&G_ux_params);
if (os_sched_last_status(TASK_BOLOS_UX) == BOLOS_UX_OK) {
break;
}
}
#endif

#ifndef HAVE_BOLOS
#ifdef HAVE_MCU_PROTECT
// engage RDP2 on MCU
Expand All @@ -414,13 +429,6 @@ void io_seproxyhal_init(void)
app_stack_canary = APP_STACK_CANARY_MAGIC;
#endif // HAVE_BOLOS_APP_STACK_CANARY

#if !defined(HAVE_BOLOS) && !defined(BOLOS_OS_UPGRADER_APP)
// Warn UX layer of io reset to avoid unwanted pin lock
memset(&G_ux_params, 0, sizeof(G_ux_params));
G_ux_params.ux_id = BOLOS_UX_IO_RESET;
os_ux(&G_ux_params);
#endif

// wipe the io structure before it's used
#ifdef HAVE_BLE
unsigned int plane = G_io_app.plane_mode;
Expand Down

0 comments on commit e94a1a4

Please sign in to comment.