diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-08-12 13:46:24 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-08-12 13:46:24 +0000 |
commit | ffbb30e0f86a774e6bfd866db36254fc7c8926d8 (patch) | |
tree | 80bac5cef243aceb837656d4a23b3a3d3d38b032 /LUFA | |
parent | fa664f8b46788f60961ed5b2ed878e10cea5236e (diff) | |
download | lufa-ffbb30e0f86a774e6bfd866db36254fc7c8926d8.tar.gz lufa-ffbb30e0f86a774e6bfd866db36254fc7c8926d8.tar.bz2 lufa-ffbb30e0f86a774e6bfd866db36254fc7c8926d8.zip |
Added workaround for broken VBUS detection on AVR8 devices when a bootloader starts the application via a software jump without first turning off the OTG pad (thanks to Simon Inns)
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/DoxygenPages/ChangeLog.txt | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index ed0e9e8df..4f361c5f7 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -15,7 +15,8 @@ * * <b>Changed:</b> * - Core: - * - <i>None</i> + * - Added workaround for broken VBUS detection on AVR8 devices when a bootloader starts the application + * via a software jump without first turning off the OTG pad (thanks to Simon Inns) * - Library Applications: * - <i>None</i> * diff --git a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c index 1f37dfd49..8285f7e92 100644 --- a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c +++ b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c @@ -63,6 +63,13 @@ void USB_Init( USB_Options = Options; #endif + #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) + /* Workaround for AVR8 bootloaders that fail to turn off the OTG pad before running + * the loaded application. This causes VBUS detection to fail unless we first force + * it off to reset it. */ + USB_OTGPAD_Off(); + #endif + if (!(USB_Options & USB_OPT_REG_DISABLED)) USB_REG_On(); else |