diff --git a/core/embed/firmware/mpconfigport.h b/core/embed/firmware/mpconfigport.h index 086630e837..8ac3bbf366 100644 --- a/core/embed/firmware/mpconfigport.h +++ b/core/embed/firmware/mpconfigport.h @@ -188,7 +188,12 @@ typedef long mp_off_t; #define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq() #define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state) -#define MICROPY_EVENT_POLL_HOOK __WFI(); +#define MICROPY_EVENT_POLL_HOOK \ + do { \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ + __WFI(); \ + } while (0); #define MICROPY_HW_BOARD_NAME "TREZORv2" #define MICROPY_HW_MCU_NAME "STM32F427xx" diff --git a/core/embed/unix/mpconfigport.h b/core/embed/unix/mpconfigport.h index 9901b06d8c..3b7e92f592 100644 --- a/core/embed/unix/mpconfigport.h +++ b/core/embed/unix/mpconfigport.h @@ -228,7 +228,12 @@ typedef unsigned int mp_uint_t; // must be pointer size #endif #endif -#define MICROPY_EVENT_POLL_HOOK mp_hal_delay_ms(1); +#define MICROPY_EVENT_POLL_HOOK \ + do { \ + extern void mp_handle_pending(bool); \ + mp_handle_pending(true); \ + mp_hal_delay_us(500); \ + } while (0); // Cannot include , as it may lead to symbol name clashes #if _FILE_OFFSET_BITS == 64 && !defined(__LP64__)