\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
return ENDPOINT_READYWAIT_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_READYWAIT_BusSuspended;\r
else if (Endpoint_IsStalled())\r
return ENDPOINT_READYWAIT_EndpointStalled;\r
\r
*/\r
ENDPOINT_READYWAIT_DeviceDisconnected = 2, /**< Device was disconnected from the host while\r
* waiting for the endpoint to become ready.\r
- */ \r
- ENDPOINT_READYWAIT_Timeout = 3, /**< The host failed to accept or send the next packet\r
+ */\r
+ ENDPOINT_READYWAIT_BusSuspended = 3, /**< The USB bus has been suspended by the host and\r
+ * no USB endpoint traffic can occur until the bus\r
+ * has resumed.\r
+ */\r
+ ENDPOINT_READYWAIT_Timeout = 4, /**< The host failed to accept or send the next packet\r
* within the software timeout period set by the\r
* \ref USB_STREAM_TIMEOUT_MS macro.\r
*/\r
ENDPOINT_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during\r
* the transfer.\r
*/\r
- ENDPOINT_RWSTREAM_Timeout = 3, /**< The host failed to accept or send the next packet\r
+ ENDPOINT_RWSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and\r
+ * no USB endpoint traffic can occur until the bus\r
+ * has resumed.\r
+ */\r
+ ENDPOINT_RWSTREAM_Timeout = 4, /**< The host failed to accept or send the next packet\r
* within the software timeout period set by the\r
* \ref USB_STREAM_TIMEOUT_MS macro.\r
*/\r
- ENDPOINT_RWSTREAM_CallbackAborted = 4, /**< Indicates that the stream's callback function\r
+ ENDPOINT_RWSTREAM_CallbackAborted = 5, /**< Indicates that the stream's callback function\r
* aborted the transfer early.\r
*/\r
};\r
ENDPOINT_RWCSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during\r
* the transfer.\r
*/\r
+ ENDPOINT_RWCSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and\r
+ * no USB endpoint traffic can occur until the bus\r
+ * has resumed.\r
+ */\r
};\r
\r
/* Inline Functions: */\r
\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_RWCSTREAM_BusSuspended;\r
\r
if (Endpoint_IsOUTReceived())\r
{\r
{\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_RWCSTREAM_BusSuspended;\r
}\r
\r
return ENDPOINT_RWCSTREAM_NoError;\r
\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_RWCSTREAM_BusSuspended;\r
\r
if (Endpoint_IsINReady())\r
{\r
while (!(Endpoint_IsOUTReceived()))\r
{\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
- return ENDPOINT_RWCSTREAM_DeviceDisconnected; \r
+ return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_RWCSTREAM_BusSuspended;\r
}\r
\r
return ENDPOINT_RWCSTREAM_NoError;\r
* - Added new Relay Controller Board project (thanks to OBinou)\r
* - Added board hardware driver support for the Teensy, USBTINY MKII, Benito and JM-DB-U2 lines of third party USB AVR boards\r
* - Added new ATTR_NO_INIT variable attribute for global variables that should not be automatically cleared on startup\r
+ * - Added new ENDPOINT_*_BusSuspended error code to the Endpoint function, so that the stream functions early-abort if the bus\r
+ * is suspended before or during a transfer\r
*\r
* <b>Changed:</b>\r
* - AVRISP programmer project now has a more robust timeout system, allowing for an increase of the software USART speed\r
* for them to be enabled (thanks to Andrei Krainev)\r
* - The Audio_Device_IsSampleReceived() and Audio_Device_IsReadyForNextSample() functions are now inline, to reduce overhead\r
* - Removed the cast to uint16_t on the set baud rate in the USBtoSerial project, so that the higher >1M baud rates can be\r
- * selected (thanks to Steffan)\r
+ * selected (thanks to Steffan Woltjer)\r
*\r
* <b>Fixed:</b>\r
* - Fixed software PDI/TPI programming mode in the AVRISP project not correctly toggling just the clock pin\r
* -# Alternative (USB-IF endorsed) USB-CDC Ethernet Class\r
* -# USB Test and Measurement Class\r
* -# Finish BluetoothHost demo\r
- * -# Finish MIDI class Bootloader\r
* -# Finish SideShow demo\r
* -# Finish StandaloneProgrammer project\r
* -# Finish MIDIToneGenerator project\r
* - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig\r
* - CD Driver Emulator Dongle for ISO Files: http://cdemu.blogspot.com/\r
* - ClockTamer, a configurable clock generator: http://code.google.com/p/clock-tamer/\r
+ * - EMUCOMBOX, a USB-RS422 adapter for E-Mu Emax samplers: http://users.skynet.be/emxp/EMUCOMBOX.htm\r
* - "Fingerlicking Wingdinger" (WARNING: Bad Language if no Javascript), a MIDI controller: http://noisybox.net/electronics/wingdinger/\r
* - Garmin GPS USB to NMEA standard serial sentence translator: http://github.com/nall/garmin-transmogrifier/tree/master\r
* - Generic HID Device Creator: http://generichid.sourceforge.net/\r
BITBANG_PDIDATA_DDR |= BITBANG_PDIDATA_MASK;\r
BITBANG_PDICLOCK_DDR |= BITBANG_PDICLOCK_MASK;\r
\r
- /* Set DATA line low for at least 90ns to ensure that the device is ready for PDI mode to be entered */\r
+ /* Set DATA line low for at least 1ms to ensure that the device is ready for PDI mode to be entered */\r
BITBANG_PDIDATA_PORT &= ~BITBANG_PDIDATA_MASK;\r
- _delay_us(1);\r
+ _delay_ms(1);\r
\r
/* Set DATA line high for at least 90ns to disable /RESET functionality */\r
BITBANG_PDIDATA_PORT |= BITBANG_PDIDATA_MASK;\r
http://www.fourwalledcubicle.com/LUFA.php\r
=========================================\r
\r
- LUFA IS DONATION SUPPORTED. To support LUFA, \r
+ LUFA is donation supported. To support LUFA, \r
please donate at http://www.fourwalledcubicle.com.\r
\r
For Commercial Licensing information, see\r