Make sure the device is attached before sending the report
This commit is contained in:
@@ -7,6 +7,9 @@ uint8_t GenericHidOutBuffer[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||
|
||||
static usb_status_t UsbReceiveData(void)
|
||||
{
|
||||
if (!UsbCompositeDevice.attach)
|
||||
return kStatus_USB_Error; // The device is not attached
|
||||
|
||||
return USB_DeviceHidRecv(UsbCompositeDevice.genericHidHandle,
|
||||
USB_GENERIC_HID_ENDPOINT_OUT_INDEX,
|
||||
GenericHidInBuffer,
|
||||
|
||||
Reference in New Issue
Block a user