/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
/* Get the pointer to the transfer request associated with the control endpoint. */
transfer_request = &device -> ux_slave_device_control_endpoint.ux_slave_endpoint_transfer_request;
/* Extract the request type from the SETUP packet.. */
request = *(transfer_request -> ux_slave_transfer_request_setup + UX_SETUP_REQUEST);
...
switch (request)
{
case UX_SLAVE_CLASS_STORAGE_RESET:
...
break;
case UX_SLAVE_CLASS_STORAGE_GET_MAX_LUN:
...
break;
default:
/* Unknown function. It's not handled. */
return(UX_ERROR);
}
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
/* Get the pointer to the transfer request associated with the control endpoint. */
transfer_request = &device -> ux_slave_device_control_endpoint.ux_slave_endpoint_transfer_request;
/* Extract the request type from the SETUP packet.. */
request = *(transfer_request -> ux_slave_transfer_request_setup + UX_SETUP_REQUEST);
...
switch (request)
{
case UX_SLAVE_CLASS_STORAGE_RESET:
...
break;
case UX_SLAVE_CLASS_STORAGE_GET_MAX_LUN:
...
break;
default:
/* Unknown function. It's not handled. */
return(UX_ERROR);
}