From 7b79325aa037db9786f0da069c11315a3f6d9721 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 13 Apr 2010 23:29:11 +0000 Subject: Removed two-step endpoint/pipe bank clear and switch sequence for smaller, faster endpoint/pipe code. Added spacing between multiple paragraphs in Doxygen \note sections. Removed call to the clock prescaler reset function in the Teensy bootloader to save space - the user application is accessed via a watchdog reset anyway, so the prescale reset would only affect the speed of the bootloader itself. --- LUFA/Drivers/USB/LowLevel/LowLevel.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'LUFA/Drivers/USB/LowLevel/LowLevel.c') diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index f4f277ccb..c9d0493b4 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.c +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.c @@ -113,9 +113,18 @@ void USB_ShutDown(void) USB_Detach(); USB_Controller_Disable(); + USB_INT_DisableAllInterrupts(); + USB_INT_ClearAllInterrupts(); + + #if defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) + UHWCON &= ~(1 << UIMOD); + #endif + if (!(USB_Options & USB_OPT_MANUAL_PLL)) USB_PLL_Off(); + USB_REG_Off(); + #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) USB_OTGPAD_Off(); #endif @@ -145,11 +154,11 @@ void USB_ResetInterface(void) USB_ConfigurationNumber = 0; #if !defined(NO_DEVICE_REMOTE_WAKEUP) - USB_RemoteWakeupEnabled = false; + USB_RemoteWakeupEnabled = false; #endif #if !defined(NO_DEVICE_SELF_POWER) - USB_CurrentlySelfPowered = false; + USB_CurrentlySelfPowered = false; #endif #endif @@ -217,9 +226,9 @@ void USB_ResetInterface(void) USB_INT_Clear(USB_INT_EORSTI); USB_INT_Enable(USB_INT_EORSTI); - #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) - USB_INT_Enable(USB_INT_VBUS); - #endif + #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) + USB_INT_Enable(USB_INT_VBUS); + #endif #elif defined(USB_HOST_ONLY) USB_Host_HostMode_On(); -- cgit v1.2.3