From d5e874d3480e6806223cd2fc05d9c9bb85e9d95e Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 25 Jul 2011 09:56:21 +0000 Subject: Add INTERRUPT_CONTROL_ENDPOINT compile time option support for the UC3 devices. --- LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c') diff --git a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c index d92011ff6..fec007cdc 100644 --- a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c +++ b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c @@ -121,6 +121,10 @@ ISR(USB_GEN_vect) ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize, ENDPOINT_BANK_SINGLE); + #if defined(INTERRUPT_CONTROL_ENDPOINT) + USB_INT_Enable(USB_INT_RXSTPI); + #endif + EVENT_USB_Device_Reset(); } #endif @@ -200,3 +204,22 @@ ISR(USB_GEN_vect) } #endif } + +#if defined(INTERRUPT_CONTROL_ENDPOINT) && defined(USB_CAN_BE_DEVICE) +ISR(USB_COM_vect, ISR_BLOCK) +{ + uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint(); + + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + USB_INT_Disable(USB_INT_RXSTPI); + + GlobalInterruptEnable(); + + USB_Device_ProcessControlRequest(); + + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + USB_INT_Enable(USB_INT_RXSTPI); + Endpoint_SelectEndpoint(PrevSelectedEndpoint); +} +#endif + -- cgit v1.2.3