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.
This commit is contained in:
@@ -133,7 +133,7 @@ void USB_Printer_Host(void)
|
||||
LEDs_SetAllLEDs(LEDS_LED1);
|
||||
|
||||
/* Wait until USB device disconnected */
|
||||
while (USB_IsConnected);
|
||||
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ void USB_Printer_Host(void)
|
||||
LEDs_SetAllLEDs(LEDS_LED1);
|
||||
|
||||
/* Wait until USB device disconnected */
|
||||
while (USB_IsConnected);
|
||||
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ void USB_Printer_Host(void)
|
||||
LEDs_SetAllLEDs(LEDS_LED1);
|
||||
|
||||
/* Wait until USB device disconnected */
|
||||
while (USB_IsConnected);
|
||||
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -181,10 +181,8 @@ void USB_Printer_Host(void)
|
||||
|
||||
/* Indicate device no longer busy */
|
||||
LEDs_SetAllLEDs(LEDS_LED4);
|
||||
|
||||
/* Wait until USB device disconnected */
|
||||
while (USB_IsConnected);
|
||||
|
||||
|
||||
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user