Add new tag for the LUFA-120219-BETA release.
[pub/USBasp.git] / LUFA / Drivers / USB / Core / XMEGA / Endpoint_XMEGA.c
index e737814..662f4a3 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 uint8_t USB_Device_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
 #endif
 
-Endpoint_FIFOPair_t           USB_Endpoint_FIFOs[ENDPOINT_DETAILS_MAXEP];
+Endpoint_FIFOPair_t       USB_Endpoint_FIFOs[ENDPOINT_TOTAL_ENDPOINTS];
 
-volatile uint8_t              USB_Endpoint_SelectedEndpoint;
-volatile USB_EP_t*            USB_Endpoint_SelectedHandle;
+volatile uint8_t          USB_Endpoint_SelectedEndpoint;
+volatile USB_EP_t*        USB_Endpoint_SelectedHandle;
 volatile Endpoint_FIFO_t* USB_Endpoint_SelectedFIFO;
 
 bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
@@ -66,8 +66,11 @@ bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
 
 void Endpoint_ClearEndpoints(void)
 {
-       for (uint8_t EPNum = 0; EPNum < (ENDPOINT_TOTAL_ENDPOINTS * 2); EPNum++)
-         ((USB_EP_t*)&USB_EndpointTable)[EPNum].CTRL = 0;
+       for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)
+       {
+               USB_EndpointTable.Endpoints[EPNum].IN.CTRL  = 0;
+               USB_EndpointTable.Endpoints[EPNum].OUT.CTRL = 0;
+       }
 }
 
 void Endpoint_ClearStatusStage(void)