summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/usbdev
diff options
context:
space:
mode:
authorPavol Rusnak <stick@gk2.sk>2017-01-16 16:43:09 +0100
committerDamien George <damien.p.george@gmail.com>2017-01-19 12:34:45 +1100
commit89f2b620164c72f522613997a15d7427f693409b (patch)
treec75cc93b6b775c279a855fc02882f2b31ca81a04 /stmhal/usbdev
parentc5310ee5b545316d7b8770343908c19f1ff1cd0d (diff)
downloadmicropython-89f2b620164c72f522613997a15d7427f693409b.tar.gz
micropython-89f2b620164c72f522613997a15d7427f693409b.zip
stmhal: Fix USB HID receive not receiving the first packet.
Diffstat (limited to 'stmhal/usbdev')
-rw-r--r--stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h1
-rw-r--r--stmhal/usbdev/class/src/usbd_cdc_msc_hid.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h
index 76a7678929..7cb64fd845 100644
--- a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h
+++ b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid.h
@@ -48,6 +48,7 @@ typedef struct {
} USBD_CDC_HandleTypeDef;
typedef struct _USBD_HID_Itf {
+ int8_t (* Init) (void);
int8_t (* Receive)(uint8_t *, uint32_t);
} USBD_HID_ItfTypeDef;
diff --git a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
index d136570234..3ebc7d8280 100644
--- a/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
+++ b/stmhal/usbdev/class/src/usbd_cdc_msc_hid.c
@@ -724,6 +724,8 @@ static uint8_t USBD_CDC_MSC_HID_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx) {
USBD_EP_TYPE_INTR,
mps_out);
+ HID_fops->Init();
+
// Prepare Out endpoint to receive next packet
USBD_LL_PrepareReceive(pdev, hid_out_ep, HID_ClassData.RxBuffer, mps_out);