From 32f0f605efa293430a47d60bb857695ff6937d21 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 14 May 2009 10:07:08 +0000 Subject: Removed all user pipe/endpoint interrupt APIs, added internal library support for interrupt driven control endpoints when in device mode by defining INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch. --- Demos/Device/Mouse/Mouse.c | 50 ---------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'Demos/Device/Mouse/Mouse.c') diff --git a/Demos/Device/Mouse/Mouse.c b/Demos/Device/Mouse/Mouse.c index 8998530d8..9dc2f9d04 100644 --- a/Demos/Device/Mouse/Mouse.c +++ b/Demos/Device/Mouse/Mouse.c @@ -39,10 +39,7 @@ /* Scheduler Task List */ TASK_LIST { - #if !defined(INTERRUPT_CONTROL_ENDPOINT) { .Task = USB_USBTask , .TaskStatus = TASK_STOP }, - #endif - { .Task = USB_Mouse_Report , .TaskStatus = TASK_STOP }, }; @@ -105,10 +102,8 @@ int main(void) */ EVENT_HANDLER(USB_Connect) { - #if !defined(INTERRUPT_CONTROL_ENDPOINT) /* Start USB management task */ Scheduler_SetTaskMode(USB_USBTask, TASK_RUN); - #endif /* Indicate USB enumerating */ UpdateStatus(Status_USBEnumerating); @@ -117,21 +112,6 @@ EVENT_HANDLER(USB_Connect) UsingReportProtocol = true; } -/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the - * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled - * asynchronously when they arrive rather than when the control endpoint is polled manually. - */ -EVENT_HANDLER(USB_Reset) -{ - #if defined(INTERRUPT_CONTROL_ENDPOINT) - /* Select the control endpoint */ - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - - /* Enable the endpoint SETUP interrupt ISR for the control endpoint */ - USB_INT_Enable(ENDPOINT_INT_SETUP); - #endif -} - /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via * the status LEDs and stops the USB management and Mouse reporting tasks. */ @@ -139,10 +119,7 @@ EVENT_HANDLER(USB_Disconnect) { /* Stop running mouse reporting and USB management tasks */ Scheduler_SetTaskMode(USB_Mouse_Report, TASK_STOP); - - #if !defined(INTERRUPT_CONTROL_ENDPOINT) Scheduler_SetTaskMode(USB_USBTask, TASK_STOP); - #endif /* Indicate USB not ready */ UpdateStatus(Status_USBNotReady); @@ -381,30 +358,3 @@ TASK(USB_Mouse_Report) SendNextReport(); } } - -#if defined(INTERRUPT_CONTROL_ENDPOINT) -/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as - * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send - * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB - * controller. It is also used to respond to standard and class specific requests send to the device on the control - * endpoint, by handing them off to the LUFA library when they are received. - */ -ISR(ENDPOINT_PIPE_vect, ISR_BLOCK) -{ - /* Save previously selected endpoint before selecting a new endpoint */ - uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint(); - - /* Check if the control endpoint has received a request */ - if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP)) - { - /* Process the control request */ - USB_USBTask(); - - /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */ - USB_INT_Clear(ENDPOINT_INT_SETUP); - } - - /* Restore previously selected endpoint */ - Endpoint_SelectEndpoint(PrevSelectedEndpoint); -} -#endif -- cgit v1.2.3