Default to kStatus_USB_Success
This commit is contained in:
@@ -35,16 +35,13 @@ usb_status_t UsbBasicKeyboardAction(void)
|
|||||||
|
|
||||||
usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Success;
|
||||||
|
|
||||||
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;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
error = kStatus_USB_InvalidRequest;
|
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventSetReport: {
|
case kUSB_DeviceHidEventSetReport: {
|
||||||
usb_device_hid_report_struct_t *report = (usb_device_hid_report_struct_t*)param;
|
usb_device_hid_report_struct_t *report = (usb_device_hid_report_struct_t*)param;
|
||||||
@@ -70,20 +67,18 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
case kUSB_DeviceHidEventGetProtocol:
|
case kUSB_DeviceHidEventGetProtocol:
|
||||||
case kUSB_DeviceHidEventSetIdle:
|
case kUSB_DeviceHidEventSetIdle:
|
||||||
case kUSB_DeviceHidEventSetProtocol:
|
case kUSB_DeviceHidEventSetProtocol:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbBasicKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbBasicKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 UsbGenericHidCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Success;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
@@ -28,22 +28,18 @@ usb_status_t UsbGenericHidCallback(class_handle_t handle, uint32_t event, void *
|
|||||||
GenericHidOutBuffer,
|
GenericHidOutBuffer,
|
||||||
USB_GENERIC_HID_OUT_BUFFER_LENGTH);
|
USB_GENERIC_HID_OUT_BUFFER_LENGTH);
|
||||||
UsbGenericHidActionCounter++;
|
UsbGenericHidActionCounter++;
|
||||||
return UsbReceiveData();
|
error = UsbReceiveData();
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
case kUSB_DeviceHidEventSetReport:
|
case kUSB_DeviceHidEventSetReport:
|
||||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||||
error = kStatus_USB_InvalidRequest;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventGetIdle:
|
case kUSB_DeviceHidEventGetIdle:
|
||||||
case kUSB_DeviceHidEventGetProtocol:
|
case kUSB_DeviceHidEventGetProtocol:
|
||||||
case kUSB_DeviceHidEventSetIdle:
|
case kUSB_DeviceHidEventSetIdle:
|
||||||
case kUSB_DeviceHidEventSetProtocol:
|
case kUSB_DeviceHidEventSetProtocol:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +48,7 @@ usb_status_t UsbGenericHidSetConfiguration(class_handle_t handle, uint8_t config
|
|||||||
if (USB_COMPOSITE_CONFIGURATION_INDEX == configuration) {
|
if (USB_COMPOSITE_CONFIGURATION_INDEX == configuration) {
|
||||||
return UsbReceiveData();
|
return UsbReceiveData();
|
||||||
}
|
}
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbGenericHidSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbGenericHidSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
@@ -60,5 +56,5 @@ usb_status_t UsbGenericHidSetInterface(class_handle_t handle, uint8_t interface,
|
|||||||
if (USB_GENERIC_HID_INTERFACE_INDEX == interface) {
|
if (USB_GENERIC_HID_INTERFACE_INDEX == interface) {
|
||||||
return UsbReceiveData();
|
return UsbReceiveData();
|
||||||
}
|
}
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,37 +33,31 @@ usb_status_t UsbMediaKeyboardAction(void)
|
|||||||
|
|
||||||
usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Success;
|
||||||
|
|
||||||
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;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
case kUSB_DeviceHidEventSetReport:
|
case kUSB_DeviceHidEventSetReport:
|
||||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||||
error = kStatus_USB_InvalidRequest;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventGetIdle:
|
case kUSB_DeviceHidEventGetIdle:
|
||||||
case kUSB_DeviceHidEventGetProtocol:
|
case kUSB_DeviceHidEventGetProtocol:
|
||||||
case kUSB_DeviceHidEventSetIdle:
|
case kUSB_DeviceHidEventSetIdle:
|
||||||
case kUSB_DeviceHidEventSetProtocol:
|
case kUSB_DeviceHidEventSetProtocol:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMediaKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbMediaKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,37 +33,31 @@ usb_status_t usbMouseAction(void)
|
|||||||
|
|
||||||
usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Success;
|
||||||
|
|
||||||
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;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
case kUSB_DeviceHidEventSetReport:
|
case kUSB_DeviceHidEventSetReport:
|
||||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||||
error = kStatus_USB_InvalidRequest;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventGetIdle:
|
case kUSB_DeviceHidEventGetIdle:
|
||||||
case kUSB_DeviceHidEventGetProtocol:
|
case kUSB_DeviceHidEventGetProtocol:
|
||||||
case kUSB_DeviceHidEventSetIdle:
|
case kUSB_DeviceHidEventSetIdle:
|
||||||
case kUSB_DeviceHidEventSetProtocol:
|
case kUSB_DeviceHidEventSetProtocol:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMouseSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbMouseSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMouseSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbMouseSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,37 +33,31 @@ usb_status_t UsbSystemKeyboardAction(void)
|
|||||||
|
|
||||||
usb_status_t UsbSystemKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbSystemKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Success;
|
||||||
|
|
||||||
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;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
case kUSB_DeviceHidEventSetReport:
|
case kUSB_DeviceHidEventSetReport:
|
||||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||||
error = kStatus_USB_InvalidRequest;
|
|
||||||
break;
|
|
||||||
case kUSB_DeviceHidEventGetIdle:
|
case kUSB_DeviceHidEventGetIdle:
|
||||||
case kUSB_DeviceHidEventGetProtocol:
|
case kUSB_DeviceHidEventGetProtocol:
|
||||||
case kUSB_DeviceHidEventSetIdle:
|
case kUSB_DeviceHidEventSetIdle:
|
||||||
case kUSB_DeviceHidEventSetProtocol:
|
case kUSB_DeviceHidEventSetProtocol:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbSystemKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbSystemKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbSystemKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbSystemKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user