Added new ENDPOINT_*_BusSuspended error code to the Endpoint function, so that the...
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 3 May 2010 07:41:22 +0000 (07:41 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 3 May 2010 07:41:22 +0000 (07:41 +0000)
LUFA/Drivers/USB/LowLevel/Endpoint.c
LUFA/Drivers/USB/LowLevel/Endpoint.h
LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c
LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/FutureChanges.txt
LUFA/ManPages/LUFAPoweredProjects.txt
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
README.txt

index 81fef1c..5560c80 100644 (file)
@@ -120,6 +120,8 @@ uint8_t Endpoint_WaitUntilReady(void)
                \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
index b18ff45..93412f5 100644 (file)
                                                                                 */\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
index 6948296..92b5396 100644 (file)
@@ -12,6 +12,8 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length)
 \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
@@ -29,6 +31,8 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length)
        {\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
index 7868060..8a5be11 100644 (file)
@@ -18,6 +18,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)
                \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
@@ -38,7 +40,9 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)
        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
index 81e7189..8d5a7ab 100644 (file)
@@ -13,6 +13,8 @@
   *  - 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
@@ -32,7 +34,7 @@
   *    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
index b0e31e8..04a5fc6 100644 (file)
@@ -30,7 +30,6 @@
   *      -# 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
index 75c2d6a..41a41ae 100644 (file)
@@ -40,6 +40,7 @@
  *  - 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
index 6adb24f..e2c6fd6 100644 (file)
@@ -165,9 +165,9 @@ void XPROGTarget_EnableTargetPDI(void)
        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
index f5dab3e..a77b862 100644 (file)
@@ -10,7 +10,7 @@
                   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