diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-08 07:43:33 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-08 07:43:33 +0000 |
commit | 2281750b5fdf046ed606e567eb60cf4e647015dd (patch) | |
tree | 74b5011a55f12a768f4232fdc771937d8e124e02 | |
parent | 3757b1760fdd197a8c7227bbfd0b11ee33eb99e6 (diff) | |
download | lufa-2281750b5fdf046ed606e567eb60cf4e647015dd.tar.gz lufa-2281750b5fdf046ed606e567eb60cf4e647015dd.tar.bz2 lufa-2281750b5fdf046ed606e567eb60cf4e647015dd.zip |
Make sure that USB_STREAM_TIMEOUT_MS is set in the MassStorageHost ClassDriver demo, so that slow devices don't time out the data pipe. Increase pipe timeout in both MassStorageHost demos to 5 seconds to account for the really slow devices.
Fix TeensyHID bootloader not properly shutting down the USB interface to trigger a disconnection on the host before resetting the AVR.
-rw-r--r-- | Bootloaders/TeensyHID/TeensyHID.c | 6 | ||||
-rw-r--r-- | Demos/Host/ClassDriver/MassStorageHost/makefile | 1 | ||||
-rw-r--r-- | Demos/Host/LowLevel/MassStorageHost/makefile | 2 | ||||
-rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 3 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/PDIProtocol.c | 5 |
5 files changed, 11 insertions, 6 deletions
diff --git a/Bootloaders/TeensyHID/TeensyHID.c b/Bootloaders/TeensyHID/TeensyHID.c index 4b9224abc..84ec7aac7 100644 --- a/Bootloaders/TeensyHID/TeensyHID.c +++ b/Bootloaders/TeensyHID/TeensyHID.c @@ -51,9 +51,9 @@ int main(void) while (RunBootloader)
USB_USBTask();
-
- /* Wait 100ms to give the host time to register the disconnection */
- _delay_ms(100);
+
+ /* Turn off the USB interface, disconnect from the host */
+ USB_ShutDown();
/* Enable the watchdog and force a timeout to reset the AVR */
wdt_enable(WDTO_250MS);
diff --git a/Demos/Host/ClassDriver/MassStorageHost/makefile b/Demos/Host/ClassDriver/MassStorageHost/makefile index 24d9ee0b0..88d5cf27d 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/makefile +++ b/Demos/Host/ClassDriver/MassStorageHost/makefile @@ -118,6 +118,7 @@ LUFA_PATH = ../../../.. # LUFA library compile-time options
LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
+LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=5000
# List C source files here. (C dependencies are automatically generated.)
diff --git a/Demos/Host/LowLevel/MassStorageHost/makefile b/Demos/Host/LowLevel/MassStorageHost/makefile index 43309a3d4..756763249 100644 --- a/Demos/Host/LowLevel/MassStorageHost/makefile +++ b/Demos/Host/LowLevel/MassStorageHost/makefile @@ -119,7 +119,7 @@ LUFA_PATH = ../../../.. LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
-LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=2000
+LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=5000
# List C source files here. (C dependencies are automatically generated.)
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index e68bf89e4..1fdd96626 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -11,7 +11,8 @@ * <b>New:</b>
* - Added activity LED indicators to the AVRISP project to indicate when the device is busy processing a command
* - The USB target family and allowable USB mode tokens are now public and documented (USB_CAN_BE_*, USB_SERIES_*_AVR)
- * - Added new XPLAIN USB to Serial Bridge project (thanks to John Steggall for initial proof-of-concept)
+ * - Added new XPLAIN USB to Serial Bridge project (thanks to John Steggall for initial proof-of-concept, David Prentice
+ * and Peter Danneger for revised software USART code)
* - Added new RNDIS Ethernet Host LowLevel demo
* - Added new RNDIS Ethernet Host Class Driver
* - Added new RNDIS Ethernet Host ClassDriver demo
diff --git a/Projects/AVRISP/Lib/PDIProtocol.c b/Projects/AVRISP/Lib/PDIProtocol.c index 93634a022..d98c51c43 100644 --- a/Projects/AVRISP/Lib/PDIProtocol.c +++ b/Projects/AVRISP/Lib/PDIProtocol.c @@ -109,7 +109,10 @@ static void PDIProtocol_EnterXPROGMode(void) /* Must hold DATA line high for at least 90nS to enable PDI interface */
PDIDATA_LINE_PORT |= PDIDATA_LINE_MASK;
- _delay_us(1);
+ asm volatile ("NOP"::);
+ #if (F_CPU > 8000000)
+ asm volatile ("NOP"::);
+ #endif
/* Toggle CLOCK line 16 times within 100uS of the original 90nS timeout to keep PDI interface enabled */
for (uint8_t i = 0; i < 16; i++)
|