aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-07-13 05:34:43 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-07-13 05:34:43 +0000
commit0fcbe22c9eb68f5769bf57469e1bcf9b340d0ae3 (patch)
tree3c9c1613def7ed9c299d197c9a97fe7622eb987d /Demos/Host/Incomplete/PrinterHost/PrinterHost.c
parenta54ed0085b29f81946f3652bd412103292da7589 (diff)
downloadlufa-0fcbe22c9eb68f5769bf57469e1bcf9b340d0ae3.tar.gz
lufa-0fcbe22c9eb68f5769bf57469e1bcf9b340d0ae3.tar.bz2
lufa-0fcbe22c9eb68f5769bf57469e1bcf9b340d0ae3.zip
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.
Diffstat (limited to 'Demos/Host/Incomplete/PrinterHost/PrinterHost.c')
-rw-r--r--Demos/Host/Incomplete/PrinterHost/PrinterHost.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Demos/Host/Incomplete/PrinterHost/PrinterHost.c b/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
index df80789dd..7b98542d0 100644
--- a/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
+++ b/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
@@ -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;
}
}