diff options
Diffstat (limited to 'stmhal/usb.c')
-rw-r--r-- | stmhal/usb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c index ac85c5371..7eb3f179a 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -636,6 +636,9 @@ STATIC mp_uint_t pyb_usb_hid_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_ if (request == MP_STREAM_POLL) { mp_uint_t flags = arg; ret = 0; + if ((flags & MP_STREAM_POLL_RD) && USBD_HID_RxNum() > 0) { + ret |= MP_STREAM_POLL_RD; + } if ((flags & MP_STREAM_POLL_WR) && USBD_HID_CanSendReport(&hUSBDDevice)) { ret |= MP_STREAM_POLL_WR; } |