aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-09-22 04:20:45 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-09-22 04:20:45 +0000
commit5f3c4cc6e044bdfd4c35b5e27a2841b961766843 (patch)
tree9e88f349307a63cedbf9e4cf6b35b57c366726d3 /LUFA/Drivers/USB/LowLevel
parentc459ef69815366c11d2d00c51b75908603ed3ca1 (diff)
downloadlufa-5f3c4cc6e044bdfd4c35b5e27a2841b961766843.tar.gz
lufa-5f3c4cc6e044bdfd4c35b5e27a2841b961766843.tar.bz2
lufa-5f3c4cc6e044bdfd4c35b5e27a2841b961766843.zip
Reverted modifications to USBInterrupt.h that were intefering with correct host mode operation.
Fixed SUSPI interrupt not being cleared during device mode enumeration, causing accidental mis-fires on re-enumeration. Fixed JTAG_DEBUG_POINT() and JTAG_DEBUG_BREAK() macros not compiling under pure C99 standards mode.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel')
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBController.c1
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBInterrupt.c17
2 files changed, 7 insertions, 11 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/USBController.c b/LUFA/Drivers/USB/LowLevel/USBController.c
index 51e560483..a542353eb 100644
--- a/LUFA/Drivers/USB/LowLevel/USBController.c
+++ b/LUFA/Drivers/USB/LowLevel/USBController.c
@@ -203,6 +203,7 @@ static void USB_Init_Device(void)
ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
ENDPOINT_BANK_SINGLE);
+ USB_INT_Clear(USB_INT_SUSPI);
USB_INT_Enable(USB_INT_SUSPI);
USB_INT_Enable(USB_INT_EORSTI);
diff --git a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
index 66a86a1b2..7844a87d7 100644
--- a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
+++ b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
@@ -34,7 +34,7 @@
void USB_INT_DisableAllInterrupts(void)
{
#if defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
- USBCON &= ~((1 << OTGPADE) | (1 << VBUSTE) | (1 << IDTE));
+ USBCON &= ~((1 << VBUSTE) | (1 << IDTE));
#elif defined(USB_SERIES_4_AVR)
USBCON &= ~(1 << VBUSTE);
#endif
@@ -168,8 +168,6 @@ ISR(USB_GEN_vect, ISR_BLOCK)
#endif
#if defined(USB_CAN_BE_HOST)
- bool MustResetInterface = false;
-
if (USB_INT_HasOccurred(USB_INT_DDISCI) && USB_INT_IsEnabled(USB_INT_DDISCI))
{
USB_INT_Clear(USB_INT_DDISCI);
@@ -177,8 +175,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
USB_INT_Disable(USB_INT_DDISCI);
EVENT_USB_Host_DeviceUnattached();
-
- MustResetInterface = true;
+
+ USB_ResetInterface();
}
if (USB_INT_HasOccurred(USB_INT_VBERRI) && USB_INT_IsEnabled(USB_INT_VBERRI))
@@ -213,7 +211,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
EVENT_USB_Host_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);
EVENT_USB_Host_DeviceUnattached();
- MustResetInterface = true;
+ USB_ResetInterface();
}
if (USB_INT_HasOccurred(USB_INT_HSOFI) && USB_INT_IsEnabled(USB_INT_HSOFI))
@@ -236,13 +234,10 @@ ISR(USB_GEN_vect, ISR_BLOCK)
EVENT_USB_Host_DeviceUnattached();
USB_CurrentMode = USB_GetUSBModeFromUID();
- EVENT_USB_UIDChange();
+ USB_ResetInterface();
- MustResetInterface = true;
+ EVENT_USB_UIDChange();
}
-
- if (MustResetInterface)
- USB_ResetInterface();
#endif
}