Revert "Default to kStatus_USB_Success"
This reverts commit 6eceb6ad30.
This commit is contained in:
@@ -38,15 +38,17 @@ usb_status_t UsbBasicKeyboardAction(void)
|
||||
|
||||
usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||
{
|
||||
usb_status_t error = kStatus_USB_Success;
|
||||
usb_status_t error = kStatus_USB_Error;
|
||||
|
||||
switch (event) {
|
||||
// This report is received when the report has been sent
|
||||
case kUSB_DeviceHidEventSendResponse:
|
||||
UsbReportUpdateSemaphore &= ~(1 << USB_BASIC_KEYBOARD_INTERFACE_INDEX);
|
||||
error = kStatus_USB_Success;
|
||||
break;
|
||||
case kUSB_DeviceHidEventRecvResponse:
|
||||
case kUSB_DeviceHidEventGetReport:
|
||||
error = kStatus_USB_InvalidRequest;
|
||||
break;
|
||||
case kUSB_DeviceHidEventSetReport: {
|
||||
usb_device_hid_report_struct_t *report = (usb_device_hid_report_struct_t*)param;
|
||||
@@ -72,18 +74,20 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
||||
case kUSB_DeviceHidEventGetProtocol:
|
||||
case kUSB_DeviceHidEventSetIdle:
|
||||
case kUSB_DeviceHidEventSetProtocol:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
usb_status_t UsbBasicKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ static usb_status_t UsbReceiveData(void)
|
||||
|
||||
usb_status_t UsbGenericHidCallback(class_handle_t handle, uint32_t event, void *param)
|
||||
{
|
||||
usb_status_t error = kStatus_USB_Success;
|
||||
usb_status_t error = kStatus_USB_Error;
|
||||
|
||||
switch (event) {
|
||||
case kUSB_DeviceHidEventSendResponse:
|
||||
@@ -28,18 +28,22 @@ usb_status_t UsbGenericHidCallback(class_handle_t handle, uint32_t event, void *
|
||||
GenericHidOutBuffer,
|
||||
USB_GENERIC_HID_OUT_BUFFER_LENGTH);
|
||||
UsbGenericHidActionCounter++;
|
||||
error = UsbReceiveData();
|
||||
return UsbReceiveData();
|
||||
break;
|
||||
case kUSB_DeviceHidEventGetReport:
|
||||
case kUSB_DeviceHidEventSetReport:
|
||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||
error = kStatus_USB_InvalidRequest;
|
||||
break;
|
||||
case kUSB_DeviceHidEventGetIdle:
|
||||
case kUSB_DeviceHidEventGetProtocol:
|
||||
case kUSB_DeviceHidEventSetIdle:
|
||||
case kUSB_DeviceHidEventSetProtocol:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -48,7 +52,7 @@ usb_status_t UsbGenericHidSetConfiguration(class_handle_t handle, uint8_t config
|
||||
if (USB_COMPOSITE_CONFIGURATION_INDEX == configuration) {
|
||||
return UsbReceiveData();
|
||||
}
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
usb_status_t UsbGenericHidSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||
@@ -56,5 +60,5 @@ usb_status_t UsbGenericHidSetInterface(class_handle_t handle, uint8_t interface,
|
||||
if (USB_GENERIC_HID_INTERFACE_INDEX == interface) {
|
||||
return UsbReceiveData();
|
||||
}
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
@@ -36,33 +36,38 @@ usb_status_t UsbMediaKeyboardAction(void)
|
||||
|
||||
usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||
{
|
||||
usb_status_t error = kStatus_USB_Success;
|
||||
usb_status_t error = kStatus_USB_Error;
|
||||
|
||||
switch (event) {
|
||||
// This report is received when the report has been sent
|
||||
case kUSB_DeviceHidEventSendResponse:
|
||||
UsbReportUpdateSemaphore &= ~(1 << USB_MEDIA_KEYBOARD_INTERFACE_INDEX);
|
||||
error = kStatus_USB_Success;
|
||||
break;
|
||||
case kUSB_DeviceHidEventRecvResponse:
|
||||
case kUSB_DeviceHidEventGetReport:
|
||||
case kUSB_DeviceHidEventSetReport:
|
||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||
error = kStatus_USB_InvalidRequest;
|
||||
break;
|
||||
case kUSB_DeviceHidEventGetIdle:
|
||||
case kUSB_DeviceHidEventGetProtocol:
|
||||
case kUSB_DeviceHidEventSetIdle:
|
||||
case kUSB_DeviceHidEventSetProtocol:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
usb_status_t UsbMediaKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
@@ -36,33 +36,38 @@ usb_status_t UsbMouseAction(void)
|
||||
|
||||
usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param)
|
||||
{
|
||||
usb_status_t error = kStatus_USB_Success;
|
||||
usb_status_t error = kStatus_USB_Error;
|
||||
|
||||
switch (event) {
|
||||
// This report is received when the report has been sent
|
||||
case kUSB_DeviceHidEventSendResponse:
|
||||
UsbReportUpdateSemaphore &= ~(1 << USB_MOUSE_INTERFACE_INDEX);
|
||||
error = kStatus_USB_Success;
|
||||
break;
|
||||
case kUSB_DeviceHidEventRecvResponse:
|
||||
case kUSB_DeviceHidEventGetReport:
|
||||
case kUSB_DeviceHidEventSetReport:
|
||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||
error = kStatus_USB_InvalidRequest;
|
||||
break;
|
||||
case kUSB_DeviceHidEventGetIdle:
|
||||
case kUSB_DeviceHidEventGetProtocol:
|
||||
case kUSB_DeviceHidEventSetIdle:
|
||||
case kUSB_DeviceHidEventSetProtocol:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
usb_status_t UsbMouseSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
usb_status_t UsbMouseSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
@@ -36,33 +36,38 @@ usb_status_t UsbSystemKeyboardAction(void)
|
||||
|
||||
usb_status_t UsbSystemKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||
{
|
||||
usb_status_t error = kStatus_USB_Success;
|
||||
usb_status_t error = kStatus_USB_Error;
|
||||
|
||||
switch (event) {
|
||||
// This report is received when the report has been sent
|
||||
case kUSB_DeviceHidEventSendResponse:
|
||||
UsbReportUpdateSemaphore &= ~(1 << USB_SYSTEM_KEYBOARD_INTERFACE_INDEX);
|
||||
error = kStatus_USB_Success;
|
||||
break;
|
||||
case kUSB_DeviceHidEventRecvResponse:
|
||||
case kUSB_DeviceHidEventGetReport:
|
||||
case kUSB_DeviceHidEventSetReport:
|
||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||
error = kStatus_USB_InvalidRequest;
|
||||
break;
|
||||
case kUSB_DeviceHidEventGetIdle:
|
||||
case kUSB_DeviceHidEventGetProtocol:
|
||||
case kUSB_DeviceHidEventSetIdle:
|
||||
case kUSB_DeviceHidEventSetProtocol:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
usb_status_t UsbSystemKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
usb_status_t UsbSystemKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||
{
|
||||
return kStatus_USB_Success;
|
||||
return kStatus_USB_Error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user