Oops - with new changes to the way the device Configuration Descriptor is retrieved...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / CDC.c
index 003a6b3..31fd8f1 100644 (file)
@@ -174,6 +174,9 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
 \r
 uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)\r
 {\r
+       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))\r
+         return 0;\r
+\r
        Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);\r
 \r
        if (Endpoint_IsOUTReceived() && !(Endpoint_BytesInEndpoint()))\r