Closed jianyibao closed 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().
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);