Make sure the device is attached before sending the report

This commit is contained in:
Kristian Sloth Lauszus
2018-06-30 16:52:39 +02:00
parent 11a8ffbaf5
commit b9b5eb2c76
5 changed files with 15 additions and 0 deletions

View File

@@ -21,6 +21,9 @@ void ResetActiveUsbMediaKeyboardReport(void)
usb_status_t UsbMediaKeyboardAction(void)
{
if (!UsbCompositeDevice.attach)
return kStatus_USB_Error; // The device is not attached
if (((usb_device_hid_struct_t *)UsbCompositeDevice.mediaKeyboardHandle)->interruptInPipeBusy)
return kStatus_USB_Busy; // The previous report has not been sent yet