Skip to content
Snippets Groups Projects
Commit ffbb30e0 authored by Dean Camera's avatar Dean Camera
Browse files

Added workaround for broken VBUS detection on AVR8 devices when a bootloader...

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)
parent fa664f8b
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
* *
* <b>Changed:</b> * <b>Changed:</b>
* - Core: * - 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: * - Library Applications:
* - <i>None</i> * - <i>None</i>
* *
......
...@@ -63,6 +63,13 @@ void USB_Init( ...@@ -63,6 +63,13 @@ void USB_Init(
USB_Options = Options; USB_Options = Options;
#endif #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)) if (!(USB_Options & USB_OPT_REG_DISABLED))
USB_REG_On(); USB_REG_On();
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment