alambe94 / I-CUBE-USBD-Composite

Create STM32 USB Composite devices with ease.
MIT License
142 stars 30 forks source link

"USBD_CUSTOM_HID_DataOut" doesn't continue next receiving #15

Closed jianyibao closed 2 years ago

jianyibao commented 2 years ago

I think the following should be inserted after "OutEvent", compared to the code of ST CubeMX. (void)USBD_LL_PrepareReceive(pdev, CUSTOM_HID_OUT_EP, hhid->Report_buf, USBD_CUSTOMHID_OUTREPORT_BUF_SIZE);

alambe94 commented 2 years ago

You need to call USBD_CUSTOM_HID_ReceivePacket() whenever you are ready to receive next packet.

You can call this in CUSTOM_HID_OutEvent() in interface file after you process the current packet.

You can check cdc acm interface file for reference. CDC_Receive().