diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-04 00:14:09 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-01-04 00:14:09 +0000 |
commit | 71e5bcee3d1121be680990cabe8ae5dff2a78807 (patch) | |
tree | 18aea050d1f71715884fcfe092c5b6e5a85506f1 /LUFA/Drivers/USB/Class | |
parent | 58a39c6666cd9b085e402d5edc49d58fb759a9a3 (diff) | |
download | lufa-71e5bcee3d1121be680990cabe8ae5dff2a78807.tar.gz lufa-71e5bcee3d1121be680990cabe8ae5dff2a78807.tar.bz2 lufa-71e5bcee3d1121be680990cabe8ae5dff2a78807.zip |
Fixed blocking CDC streams not aborting when the host is disconnected.
Diffstat (limited to 'LUFA/Drivers/USB/Class')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/CDC.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index c274853de..16bc01549 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -263,6 +263,9 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) {
while (!(CDC_Device_BytesReceived((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream))))
{
+ if (USB_DeviceState == DEVICE_STATE_Unattached)
+ return _FDEV_EOF;
+
CDC_Device_USBTask((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream));
USB_USBTask();
}
|