Make sure the composite device is attached before setting the kStatus_USB_Success flag

This commit is contained in:
Kristian Sloth Lauszus
2018-06-30 16:48:25 +02:00
parent 9938f14d20
commit 11a8ffbaf5
5 changed files with 16 additions and 4 deletions

View File

@@ -48,7 +48,9 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
switch (event) {
// This report is received when the report has been sent
case kUSB_DeviceHidEventSendResponse:
error = kStatus_USB_Success;
if (UsbCompositeDevice.attach) {
error = kStatus_USB_Success;
}
break;
case kUSB_DeviceHidEventRecvResponse:
case kUSB_DeviceHidEventGetReport: