Skip to content

Commit

Permalink
fixup! refactor(core): split polling can_read and reading from USB
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoVrahe committed Dec 4, 2024
1 parent 34559a4 commit c9188fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/embed/upymod/modtrezorio/modtrezorio-hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion core/embed/upymod/modtrezorio/modtrezorio-webusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions core/mocks/generated/trezorio/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c9188fb

Please sign in to comment.