Fixed blocking CDC streams not aborting when the host is disconnected.

This commit is contained in:
Dean Camera 2010-01-04 00:14:09 +00:00
parent 58a39c6666
commit 71e5bcee3d
4 changed files with 9 additions and 2 deletions

View file

@ -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();
}