Fixed blocking CDC streams not aborting when the host is disconnected.
This commit is contained in:
parent
58a39c6666
commit
71e5bcee3d
4 changed files with 9 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue