diff --git a/Demos/Host/Incomplete/BluetoothHost/makefile b/Demos/Host/Incomplete/BluetoothHost/makefile index 9620ffadfca5e1de7fa71f20473b984956f42477..c65cd0f5f1219cc2a0cfbb87f72a14140e34eb9c 100644 --- a/Demos/Host/Incomplete/BluetoothHost/makefile +++ b/Demos/Host/Incomplete/BluetoothHost/makefile @@ -80,7 +80,7 @@ BOARD = USBKEY # does not *change* the processor frequency - it should merely be updated to # reflect the processor speed set externally so that the code can use accurate # software delays. -F_CPU = 16000000 +F_CPU = 8000000 # Input clock frequency. diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index e939b66f3eade0f82373126953b02a8fe2ab3075..c750e4015171eb3528f32835d5de40eae7e757b6 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -85,14 +85,14 @@ * * \ingroup Group_Debugging */ - #define JTAG_DEBUG_POINT() asm volatile ("NOP" ::) + #define JTAG_DEBUG_POINT() __asm__ volatile ("NOP" ::) /** Defines an explicit JTAG break point in the resulting binary via the ASM BREAK statement. When * a JTAG is used, this causes the program execution to halt when reached until manually resumed. * * \ingroup Group_Debugging */ - #define JTAG_DEBUG_BREAK() asm volatile ("BREAK" ::) + #define JTAG_DEBUG_BREAK() __asm__ volatile ("BREAK" ::) /** Macro for testing condition "x" and breaking via JTAG_DEBUG_BREAK() if the condition is false. * diff --git a/LUFA/Drivers/USB/LowLevel/USBController.c b/LUFA/Drivers/USB/LowLevel/USBController.c index 51e560483230e73cfacff18ae58e5cdc3c367f5e..a542353ebeed77dd8143e663a45ab8019a0275be 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 66a86a1b2a1532e8ea02985b3bf7cb8bed5dc654..7844a87d7151eb3200a2702c56faa0506f380157 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 } diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index bf31f76debc41a253869434c5371f7044aa041e1..a6d04ae127738301b77152a3bbf4e46f257b5a57 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -57,6 +57,7 @@ * - Fixed SET FEATURE and CLEAR FEATURE control requests directed at an unconfigured endpoint causing request timeouts * - Fixed incorrect signature reported in the CDC class bootloader for the ATMEGA32U2 * - Fixed USB_Host_ClearPipeStall() incorrectly determining the endpoint direction from the currently selected pipe + * - Fixed JTAG_DEBUG_POINT() and JTAG_DEBUG_BREAK() macros not compiling under pure C99 standards mode * * \section Sec_ChangeLog100807 Version 100807 * <b>New:</b>