diff --git a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c index 8b41711388ceb6a65d33fc268cea64a9056a2fcd..27eabc3d4a57b5034119961b5b5ae96daf5074f9 100644 --- a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c +++ b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c @@ -75,12 +75,13 @@ void USB_Init( #if defined(USB_CAN_BE_BOTH) if (Mode == USB_MODE_UID) { - UHWCON |= (1 << UIDE); + UHWCON |= (1 << UIDE); USB_INT_Enable(USB_INT_IDTI); USB_CurrentMode = USB_GetUSBModeFromUID(); } else { + UHWCON &= ~(1 << UIDE); USB_CurrentMode = Mode; } #endif diff --git a/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c index 856ccd6267969cbec072371ca3b1906aaec755fe..89d60ebe0fbe983cd77ae7792e25d3c5fa7202b8 100644 --- a/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c +++ b/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c @@ -112,8 +112,6 @@ ISR(USB_GEN_vect, ISR_BLOCK) if (USB_INT_HasOccurred(USB_INT_SUSPI) && USB_INT_IsEnabled(USB_INT_SUSPI)) { - USB_INT_Clear(USB_INT_SUSPI); - USB_INT_Disable(USB_INT_SUSPI); USB_INT_Enable(USB_INT_WAKEUPI); diff --git a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c index 40ac381f666572a77d36ab426c580ad9f4cd88d3..a9ac2481c89fd81512e2e4bb114f73337d0a1ca5 100644 --- a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c +++ b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c @@ -117,10 +117,7 @@ void USB_ResetInterface(void) #if defined(USB_CAN_BE_BOTH) if (UIDModeSelectEnabled) - { - AVR32_USBB.USBCON.uide = true; - USB_INT_Enable(USB_INT_IDTI); - } + USB_INT_Enable(USB_INT_IDTI); #endif USB_CLK_Unfreeze(); @@ -129,6 +126,7 @@ void USB_ResetInterface(void) { #if defined(USB_CAN_BE_DEVICE) AVR32_USBB.USBCON.uimod = true; + USB_Init_Device(); #endif } @@ -136,6 +134,7 @@ void USB_ResetInterface(void) { #if defined(USB_CAN_BE_HOST) AVR32_USBB.USBCON.uimod = false; + USB_Init_Host(); #endif } @@ -180,7 +179,6 @@ static void USB_Init_Device(void) USB_INT_Enable(USB_INT_EORSTI); USB_Attach(); - USB_Device_SetDeviceAddress(0); } #endif diff --git a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c index aee8940e33f43b3736a03817e196b116081a01b8..76f4ef022ee057267e32118678922a36c84f0d6e 100644 --- a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c +++ b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c @@ -79,8 +79,6 @@ ISR(USB_GEN_vect) if (USB_INT_HasOccurred(USB_INT_SUSPI) && USB_INT_IsEnabled(USB_INT_SUSPI)) { - USB_INT_Clear(USB_INT_SUSPI); - USB_INT_Disable(USB_INT_SUSPI); USB_INT_Enable(USB_INT_WAKEUPI); diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index ea3efcdb2eb3749c5a7503414ecb18e941998e92..cf20c704be97fa5879c37a831e46308d20a418c6 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -70,7 +70,7 @@ * - Changed AVRISP-MKII project to use the Watchdog interrupt for command timeouts, to reduce CPU usage and free timer 0 * for other uses * - Updated the software USART code in the XPLAIN Bridge application so that the incomming bits are sampled at their mid-point - * instead of starting point, to give maximum reliability (thanks to Anton) + * instead of starting point, to give maximum reliability (thanks to Anton Staaf) * * <b>Fixed:</b> * - Core: @@ -88,6 +88,7 @@ * - Fixed Still Image Host class driver exiting the descriptor search routine prematurely if the data pipes (but not event pipe) * is found * - Fixed missing call to Pipe_SetInfiniteINRequests() in the Pipe_ConfigurePipe() routine + * - Fixed Remote Wakeup broken on the AVRs due to the mechanism only operating when the SUSPI bit is set (thanks to Holger Steinhaus) * - Library Applications: * - Fixed Benito project discarding incoming data from the USB virtual serial port when the USART is busy * - Fixed broken DFU bootloader, added XPLAIN support for bootloader start when XCK jumpered to ground