diff options
author | Damien George <damien.p.george@gmail.com> | 2017-06-07 16:00:18 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-06-07 16:03:45 +1000 |
commit | f86c57fedffcabbec94d4b56bb45cc627f48ab55 (patch) | |
tree | 6781b9af8082ca5f1d6402b0956dbbc6df24bef7 /stmhal/usb.c | |
parent | 3bb69f645a29429be63756616d3019e889c1d355 (diff) | |
download | micropython-f86c57fedffcabbec94d4b56bb45cc627f48ab55.tar.gz micropython-f86c57fedffcabbec94d4b56bb45cc627f48ab55.zip |
stmhal/usb: Make state for USB device private to top-level USB driver.
Diffstat (limited to 'stmhal/usb.c')
-rw-r--r-- | stmhal/usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c index 9428cf7db9..f70dea1428 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -54,7 +54,7 @@ mp_uint_t pyb_usb_flags = 0; #ifdef USE_DEVICE_MODE -USBD_HandleTypeDef hUSBDDevice; +STATIC USBD_HandleTypeDef hUSBDDevice; pyb_usb_storage_medium_t pyb_usb_storage_medium = PYB_USB_STORAGE_MEDIUM_NONE; #endif @@ -568,7 +568,7 @@ STATIC mp_obj_t pyb_usb_hid_recv(mp_uint_t n_args, const mp_obj_t *args, mp_map_ mp_obj_t o_ret = pyb_buf_get_for_recv(vals[0].u_obj, &vstr); // receive the data - int ret = USBD_HID_Rx((uint8_t*)vstr.buf, vstr.len, vals[1].u_int); + int ret = USBD_HID_Rx(&hUSBDDevice, (uint8_t*)vstr.buf, vstr.len, vals[1].u_int); // return the received data if (o_ret != MP_OBJ_NULL) { |