1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-04 21:48:17 +00:00

fixup! refactor(core): split polling can_read and reading from USB

This commit is contained in:
tychovrahe 2024-12-04 14:26:29 +01:00
parent 34559a4771
commit c9188fbcd9
3 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorio_HID_write_obj,
/// def read(self, buf: bytes, offset: int = 0, limit: int | None = None) -> int
/// """
/// Reads message using HID (device) or UDP (emulator).
/// Reads message using USB HID (device) or UDP (emulator).
/// """
STATIC mp_obj_t mod_trezorio_HID_read(size_t n_args, const mp_obj_t *args) {
mp_obj_HID_t *o = MP_OBJ_TO_PTR(args[0]);

View File

@ -129,7 +129,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorio_WebUSB_write_obj,
/// def read(self, buf: bytes, offset: int = 0, limit: int | None = None) -> int
/// """
/// Reads message using WebUSB (device) or UDP (emulator).
/// Reads message using USB WebUSB (device) or UDP (emulator).
/// """
STATIC mp_obj_t mod_trezorio_WebUSB_read(size_t n_args, const mp_obj_t *args) {
mp_obj_WebUSB_t *o = MP_OBJ_TO_PTR(args[0]);

View File

@ -34,7 +34,7 @@ class HID:
def read(self, buf: bytes, offset: int = 0, limit: int | None = None) -> int
"""
Reads message using HID (device) or UDP (emulator).
Reads message using USB HID (device) or UDP (emulator).
"""
def write_blocking(self, msg: bytes, timeout_ms: int) -> int:
@ -156,7 +156,7 @@ class WebUSB:
def read(self, buf: bytes, offset: int = 0, limit: int | None = None) -> int
"""
Reads message using WebUSB (device) or UDP (emulator).
Reads message using USB WebUSB (device) or UDP (emulator).
"""
from . import fatfs, haptic, sdcard
POLL_READ: int # wait until interface is readable and return read data