Make sure the composite device is attached before setting the kStatus_USB_Success flag
This commit is contained in:
@@ -48,7 +48,9 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This report is received when the report has been sent
|
// This report is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
error = kStatus_USB_Success;
|
if (UsbCompositeDevice.attach) {
|
||||||
|
error = kStatus_USB_Success;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ usb_status_t UsbGenericHidCallback(class_handle_t handle, uint32_t event, void *
|
|||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Error;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
// This report is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
|
if (UsbCompositeDevice.attach) {
|
||||||
|
error = kStatus_USB_Success;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
UsbProtocolHandler();
|
UsbProtocolHandler();
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This report is received when the report has been sent
|
// This report is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
error = kStatus_USB_Success;
|
if (UsbCompositeDevice.attach) {
|
||||||
|
error = kStatus_USB_Success;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This report is received when the report has been sent
|
// This report is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
error = kStatus_USB_Success;
|
if (UsbCompositeDevice.attach) {
|
||||||
|
error = kStatus_USB_Success;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ usb_status_t UsbSystemKeyboardCallback(class_handle_t handle, uint32_t event, vo
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
// This report is received when the report has been sent
|
// This report is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
error = kStatus_USB_Success;
|
if (UsbCompositeDevice.attach) {
|
||||||
|
error = kStatus_USB_Success;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
|
|||||||
Reference in New Issue
Block a user