diff options
author | Pavol Rusnak <stick@gk2.sk> | 2017-01-16 16:43:09 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-19 12:34:45 +1100 |
commit | 89f2b620164c72f522613997a15d7427f693409b (patch) | |
tree | c75cc93b6b775c279a855fc02882f2b31ca81a04 /stmhal/usb.c | |
parent | c5310ee5b545316d7b8770343908c19f1ff1cd0d (diff) | |
download | micropython-89f2b620164c72f522613997a15d7427f693409b.tar.gz micropython-89f2b620164c72f522613997a15d7427f693409b.zip |
stmhal: Fix USB HID receive not receiving the first packet.
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; |