diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-25 08:09:49 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-25 08:09:49 +0000 |
commit | 6d1adf7339b71952d1ba8616af9422fbc7333eb1 (patch) | |
tree | 1af4c2655f56f847b4b56cb1551a77e0d3afb054 /LUFA | |
parent | f070902bdb96795c497bce283288affaa9a4fc5b (diff) | |
download | lufa-6d1adf7339b71952d1ba8616af9422fbc7333eb1.tar.gz lufa-6d1adf7339b71952d1ba8616af9422fbc7333eb1.tar.bz2 lufa-6d1adf7339b71952d1ba8616af9422fbc7333eb1.zip |
Updated Benito project -- added hardware interrupt and software buffering for serial data reception to prevent missed characters, condensed pulse generation counters into a struct for clarity.
Added check to CDC_Device_BytesReceived() to ensure 0 is returned when device is not enumerated to a host.
Move AVRISP project's V2Protocol_DelayMS() function to be static inline, as it is now very minimal. Added extra project doxygen documentation.
Diffstat (limited to 'LUFA')
-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 003a6b31a..31fd8f1b0 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -174,6 +174,9 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
{
+ if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
+ return 0;
+
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
if (Endpoint_IsOUTReceived() && !(Endpoint_BytesInEndpoint()))
|