Commit 0fcbe22c authored by Dean Camera's avatar Dean Camera
Browse files

Added new HOST_STATE_WaitForDeviceRemoval host state machine state for...

Added new HOST_STATE_WaitForDeviceRemoval host state machine state for non-blocking disabling of device communications until the device has been removed (for use when an error occurs or communications with the device have completed). Changed over all host mode demos to use the new state.

Added verbose documentation for each of the USB Host state machine states.
parent a54ed008
...@@ -139,14 +139,11 @@ void Bluetooth_Management_Task(void) ...@@ -139,14 +139,11 @@ void Bluetooth_Management_Task(void)
LEDs_SetAllLEDs(LEDS_LED1); LEDs_SetAllLEDs(LEDS_LED1);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
puts_P(PSTR("Bluetooth Dongle Detected.\r\n")); puts_P(PSTR("Bluetooth Dongle Detected.\r\n"));
/* Select the control pipe for the request transfer */
Pipe_SelectPipe(PIPE_CONTROLPIPE);
/* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */ /* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */
if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful) if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful)
...@@ -158,7 +155,7 @@ void Bluetooth_Management_Task(void) ...@@ -158,7 +155,7 @@ void Bluetooth_Management_Task(void)
LEDs_SetAllLEDs(LEDS_LED1); LEDs_SetAllLEDs(LEDS_LED1);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -181,17 +178,13 @@ void Bluetooth_Management_Task(void) ...@@ -181,17 +178,13 @@ void Bluetooth_Management_Task(void)
LEDs_SetAllLEDs(LEDS_LED1); LEDs_SetAllLEDs(LEDS_LED1);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
puts_P(PSTR("Bluetooth Dongle Enumerated.\r\n")); puts_P(PSTR("Bluetooth Dongle Enumerated.\r\n"));
USB_HostState = HOST_STATE_Ready; USB_HostState = HOST_STATE_Ready;
break;
case HOST_STATE_Ready:
/* Do nothing, Bluetooth stack will take care of enumeration */
break; break;
} }
} }
...@@ -34,28 +34,15 @@ uint8_t ProcessDeviceDescriptor(void) ...@@ -34,28 +34,15 @@ uint8_t ProcessDeviceDescriptor(void)
{ {
USB_Descriptor_Device_t DeviceDescriptor; USB_Descriptor_Device_t DeviceDescriptor;
/* Standard request to get the device descriptor */
USB_ControlRequest = (USB_Request_Header_t)
{
bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),
bRequest: REQ_GetDescriptor,
wValue: (DTYPE_Device << 8),
wIndex: 0,
wLength: sizeof(USB_Descriptor_Device_t),
};
/* Select the control pipe for the request transfer */
Pipe_SelectPipe(PIPE_CONTROLPIPE);
/* Send the request to retrieve the device descriptor */ /* Send the request to retrieve the device descriptor */
if (USB_Host_SendControlRequest((void*)&DeviceDescriptor) != HOST_SENDCONTROL_Successful) if (USB_Host_GetDeviceDescriptor(&DeviceDescriptor) != HOST_SENDCONTROL_Successful)
return ControlErrorDuringDeviceRead; return ControlErrorDuringDeviceRead;
/* Validate returned data - ensure the returned data is a device descriptor */ /* Validate returned data - ensure the returned data is a device descriptor */
if (DeviceDescriptor.Header.Type != DTYPE_Device) if (DeviceDescriptor.Header.Type != DTYPE_Device)
return InvalidDeviceDataReturned; return InvalidDeviceDataReturned;
if ((DeviceDescriptor.Class != BLUETOOTH_DEVICE_CLASS) || if ((DeviceDescriptor.Class != BLUETOOTH_DEVICE_CLASS) ||
(DeviceDescriptor.SubClass != BLUETOOTH_DEVICE_SUBCLASS) || (DeviceDescriptor.SubClass != BLUETOOTH_DEVICE_SUBCLASS) ||
(DeviceDescriptor.Protocol != BLUETOOTH_DEVICE_PROTOCOL)) (DeviceDescriptor.Protocol != BLUETOOTH_DEVICE_PROTOCOL))
{ {
......
...@@ -133,7 +133,7 @@ void USB_Printer_Host(void) ...@@ -133,7 +133,7 @@ void USB_Printer_Host(void)
LEDs_SetAllLEDs(LEDS_LED1); LEDs_SetAllLEDs(LEDS_LED1);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -147,7 +147,7 @@ void USB_Printer_Host(void) ...@@ -147,7 +147,7 @@ void USB_Printer_Host(void)
LEDs_SetAllLEDs(LEDS_LED1); LEDs_SetAllLEDs(LEDS_LED1);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -173,7 +173,7 @@ void USB_Printer_Host(void) ...@@ -173,7 +173,7 @@ void USB_Printer_Host(void)
LEDs_SetAllLEDs(LEDS_LED1); LEDs_SetAllLEDs(LEDS_LED1);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -181,10 +181,8 @@ void USB_Printer_Host(void) ...@@ -181,10 +181,8 @@ void USB_Printer_Host(void)
/* Indicate device no longer busy */ /* Indicate device no longer busy */
LEDs_SetAllLEDs(LEDS_LED4); LEDs_SetAllLEDs(LEDS_LED4);
/* Wait until USB device disconnected */ USB_HostState = HOST_STATE_WaitForDeviceRemoval;
while (USB_IsConnected);
break; break;
} }
} }
...@@ -148,7 +148,7 @@ void CDC_Host_Task(void) ...@@ -148,7 +148,7 @@ void CDC_Host_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -162,7 +162,7 @@ void CDC_Host_Task(void) ...@@ -162,7 +162,7 @@ void CDC_Host_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
......
...@@ -249,7 +249,7 @@ void HID_Host_Task(void) ...@@ -249,7 +249,7 @@ void HID_Host_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -263,7 +263,7 @@ void HID_Host_Task(void) ...@@ -263,7 +263,7 @@ void HID_Host_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
......
...@@ -213,7 +213,7 @@ void Keyboard_HID_Task(void) ...@@ -213,7 +213,7 @@ void Keyboard_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -227,7 +227,7 @@ void Keyboard_HID_Task(void) ...@@ -227,7 +227,7 @@ void Keyboard_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -257,7 +257,7 @@ void Keyboard_HID_Task(void) ...@@ -257,7 +257,7 @@ void Keyboard_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
......
...@@ -148,7 +148,7 @@ void Keyboard_HID_Task(void) ...@@ -148,7 +148,7 @@ void Keyboard_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -163,7 +163,7 @@ void Keyboard_HID_Task(void) ...@@ -163,7 +163,7 @@ void Keyboard_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -182,7 +182,7 @@ void Keyboard_HID_Task(void) ...@@ -182,7 +182,7 @@ void Keyboard_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
......
...@@ -154,7 +154,7 @@ void MassStorage_Task(void) ...@@ -154,7 +154,7 @@ void MassStorage_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -168,7 +168,7 @@ void MassStorage_Task(void) ...@@ -168,7 +168,7 @@ void MassStorage_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -187,6 +187,8 @@ void MassStorage_Task(void) ...@@ -187,6 +187,8 @@ void MassStorage_Task(void)
if ((ErrorCode = MassStore_GetMaxLUN(&MassStore_MaxLUNIndex)) != HOST_SENDCONTROL_Successful) if ((ErrorCode = MassStore_GetMaxLUN(&MassStore_MaxLUNIndex)) != HOST_SENDCONTROL_Successful)
{ {
ShowDiskReadError(PSTR("Get Max LUN"), false, ErrorCode); ShowDiskReadError(PSTR("Get Max LUN"), false, ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -197,6 +199,8 @@ void MassStorage_Task(void) ...@@ -197,6 +199,8 @@ void MassStorage_Task(void)
if ((ErrorCode = MassStore_MassStorageReset()) != HOST_SENDCONTROL_Successful) if ((ErrorCode = MassStore_MassStorageReset()) != HOST_SENDCONTROL_Successful)
{ {
ShowDiskReadError(PSTR("Mass Storage Reset"), false, ErrorCode); ShowDiskReadError(PSTR("Mass Storage Reset"), false, ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -213,6 +217,8 @@ void MassStorage_Task(void) ...@@ -213,6 +217,8 @@ void MassStorage_Task(void)
if (((ErrorCode = MassStore_PreventAllowMediumRemoval(0, true)) != 0) || (SCSICommandStatus.Status != Command_Pass)) if (((ErrorCode = MassStore_PreventAllowMediumRemoval(0, true)) != 0) || (SCSICommandStatus.Status != Command_Pass))
{ {
ShowDiskReadError(PSTR("Prevent/Allow Medium Removal"), (SCSICommandStatus.Status != Command_Pass), ErrorCode); ShowDiskReadError(PSTR("Prevent/Allow Medium Removal"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -221,6 +227,8 @@ void MassStorage_Task(void) ...@@ -221,6 +227,8 @@ void MassStorage_Task(void)
if (((ErrorCode = MassStore_Inquiry(0, &InquiryData)) != 0) || (SCSICommandStatus.Status != Command_Pass)) if (((ErrorCode = MassStore_Inquiry(0, &InquiryData)) != 0) || (SCSICommandStatus.Status != Command_Pass))
{ {
ShowDiskReadError(PSTR("Inquiry"), (SCSICommandStatus.Status != Command_Pass), ErrorCode); ShowDiskReadError(PSTR("Inquiry"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -237,7 +245,9 @@ void MassStorage_Task(void) ...@@ -237,7 +245,9 @@ void MassStorage_Task(void)
if ((ErrorCode = MassStore_TestUnitReady(0)) != 0) if ((ErrorCode = MassStore_TestUnitReady(0)) != 0)
{ {
ShowDiskReadError(PSTR("Test Unit Ready"), false, ErrorCode); ShowDiskReadError(PSTR("Test Unit Ready"), false, ErrorCode);
break;
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
} }
} }
while ((SCSICommandStatus.Status != Command_Pass) && USB_IsConnected); while ((SCSICommandStatus.Status != Command_Pass) && USB_IsConnected);
...@@ -255,6 +265,8 @@ void MassStorage_Task(void) ...@@ -255,6 +265,8 @@ void MassStorage_Task(void)
if (((ErrorCode = MassStore_ReadCapacity(0, &DiskCapacity)) != 0) || (SCSICommandStatus.Status != Command_Pass)) if (((ErrorCode = MassStore_ReadCapacity(0, &DiskCapacity)) != 0) || (SCSICommandStatus.Status != Command_Pass))
{ {
ShowDiskReadError(PSTR("Read Capacity"), (SCSICommandStatus.Status != Command_Pass), ErrorCode); ShowDiskReadError(PSTR("Read Capacity"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -269,6 +281,8 @@ void MassStorage_Task(void) ...@@ -269,6 +281,8 @@ void MassStorage_Task(void)
(SCSICommandStatus.Status != Command_Pass)) (SCSICommandStatus.Status != Command_Pass))
{ {
ShowDiskReadError(PSTR("Read Device Block"), (SCSICommandStatus.Status != Command_Pass), ErrorCode); ShowDiskReadError(PSTR("Read Device Block"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -319,6 +333,8 @@ void MassStorage_Task(void) ...@@ -319,6 +333,8 @@ void MassStorage_Task(void)
(SCSICommandStatus.Status != Command_Pass)) (SCSICommandStatus.Status != Command_Pass))
{ {
ShowDiskReadError(PSTR("Read Device Block"), (SCSICommandStatus.Status != Command_Pass), ErrorCode); ShowDiskReadError(PSTR("Read Device Block"), (SCSICommandStatus.Status != Command_Pass), ErrorCode);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -339,8 +355,7 @@ void MassStorage_Task(void) ...@@ -339,8 +355,7 @@ void MassStorage_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
} }
...@@ -372,7 +387,4 @@ void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t Erro ...@@ -372,7 +387,4 @@ void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t Erro
/* Indicate device error via the status LEDs */ /* Indicate device error via the status LEDs */
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */
while (USB_IsConnected);
} }
...@@ -209,7 +209,7 @@ void Mouse_HID_Task(void) ...@@ -209,7 +209,7 @@ void Mouse_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -223,7 +223,7 @@ void Mouse_HID_Task(void) ...@@ -223,7 +223,7 @@ void Mouse_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -253,7 +253,7 @@ void Mouse_HID_Task(void) ...@@ -253,7 +253,7 @@ void Mouse_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
......
...@@ -149,7 +149,7 @@ void Mouse_HID_Task(void) ...@@ -149,7 +149,7 @@ void Mouse_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -163,7 +163,7 @@ void Mouse_HID_Task(void) ...@@ -163,7 +163,7 @@ void Mouse_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -182,7 +182,7 @@ void Mouse_HID_Task(void) ...@@ -182,7 +182,7 @@ void Mouse_HID_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
......
...@@ -149,7 +149,7 @@ void StillImage_Task(void) ...@@ -149,7 +149,7 @@ void StillImage_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -162,7 +162,7 @@ void StillImage_Task(void) ...@@ -162,7 +162,7 @@ void StillImage_Task(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
/* Wait until USB device disconnected */ /* Wait until USB device disconnected */
while (USB_IsConnected); USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -195,6 +195,8 @@ void StillImage_Task(void) ...@@ -195,6 +195,8 @@ void StillImage_Task(void)
if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)
{ {
ShowCommandError(ErrorCode, false); ShowCommandError(ErrorCode, false);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -246,6 +248,8 @@ void StillImage_Task(void) ...@@ -246,6 +248,8 @@ void StillImage_Task(void)
if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError) if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)
{ {
ShowCommandError(ErrorCode, false); ShowCommandError(ErrorCode, false);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break; break;
} }
...@@ -253,6 +257,8 @@ void StillImage_Task(void) ...@@ -253,6 +257,8 @@ void StillImage_Task(void)
if ((PIMA_ReceivedBlock.Type != CType_ResponseBlock) || (PIMA_ReceivedBlock.Code != PIMA_RESPONSE_OK)) if ((PIMA_ReceivedBlock.Type != CType_ResponseBlock) || (PIMA_ReceivedBlock.Code != PIMA_RESPONSE_OK))
{ {
ShowCommandError(PIMA_ReceivedBlock.Code, true); ShowCommandError(PIMA_ReceivedBlock.Code, true);
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;