diff --git a/micropython/extmod/modtrezormsg/modtrezormsg-stmhal.h b/micropython/extmod/modtrezormsg/modtrezormsg-stmhal.h index 1e3936874..b608696ec 100644 --- a/micropython/extmod/modtrezormsg/modtrezormsg-stmhal.h +++ b/micropython/extmod/modtrezormsg/modtrezormsg-stmhal.h @@ -31,8 +31,7 @@ ssize_t msg_send(uint8_t iface, const uint8_t *buf, size_t len) return len; } -// this should match values used in trezorui_poll_sdl_event() in modtrezorui/display-unix.h -uint32_t msg_poll_ui_event(void) +uint32_t msg_poll_touch(void) { - return touch_event(); + return touch_read(); } diff --git a/micropython/extmod/modtrezormsg/modtrezormsg-unix.h b/micropython/extmod/modtrezormsg/modtrezormsg-unix.h index fdb1adea9..9cfe69911 100644 --- a/micropython/extmod/modtrezormsg/modtrezormsg-unix.h +++ b/micropython/extmod/modtrezormsg/modtrezormsg-unix.h @@ -68,7 +68,9 @@ ssize_t msg_send(uint8_t iface, const uint8_t *buf, size_t len) return r; } -// from modtrezorui: -uint32_t trezorui_poll_event(void); +extern uint32_t trezorui_poll_event(void); -#define msg_poll_ui_event trezorui_poll_event +uint32_t msg_poll_touch(void) +{ + return trezorui_poll_event(); +} diff --git a/micropython/extmod/modtrezormsg/modtrezormsg.c b/micropython/extmod/modtrezormsg/modtrezormsg.c index faf6272f5..ddc86ccea 100644 --- a/micropython/extmod/modtrezormsg/modtrezormsg.c +++ b/micropython/extmod/modtrezormsg/modtrezormsg.c @@ -119,7 +119,7 @@ STATIC mp_obj_t mod_TrezorMsg_Msg_select(mp_obj_t self, mp_obj_t timeout_us) { timeout = 0; } for(;;) { - uint32_t e = msg_poll_ui_event(); + uint32_t e = msg_poll_touch(); if (e) { mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(4, NULL)); tuple->items[0] = MP_OBJ_NEW_SMALL_INT(TOUCH_IFACE); diff --git a/micropython/extmod/modtrezormsg/touch.h b/micropython/extmod/modtrezormsg/touch.h index 40a02759e..3acdea203 100644 --- a/micropython/extmod/modtrezormsg/touch.h +++ b/micropython/extmod/modtrezormsg/touch.h @@ -16,7 +16,7 @@ void touch_init(void) i2c_init(&I2CHandle1); } -uint32_t touch_event(void) +uint32_t touch_read(void) { static uint8_t data[16], old_data[16]; if (HAL_OK != HAL_I2C_Master_Receive(&I2CHandle1, 56 << 1, data, 16, 1)) {