diff options
Diffstat (limited to 'stmhal/usb.c')
-rw-r--r-- | stmhal/usb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c index 5ba5ddc6e7..ac85c53714 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -607,7 +607,11 @@ STATIC mp_obj_t pyb_usb_hid_send(mp_obj_t self_in, mp_obj_t report_in) { } // send the data - USBD_HID_SendReport(&hUSBDDevice, bufinfo.buf, bufinfo.len); + if (USBD_OK == USBD_HID_SendReport(&hUSBDDevice, bufinfo.buf, bufinfo.len)) { + return mp_obj_new_int(bufinfo.len); + } else { + return mp_obj_new_int(0); + } #endif return mp_const_none; |