Fix XMEGA core USB driver endpoint code to prevent incorrect STALL determination.
[pub/lufa.git] / LUFA / Drivers / USB / Core / XMEGA / Endpoint_XMEGA.c
index ead993e..23c1520 100644 (file)
@@ -52,14 +52,14 @@ bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Number,
 {
        Endpoint_SelectEndpoint(Number | Direction);
        
-       USB_Endpoint_SelectedHandle->CTRL      = 0;
-       USB_Endpoint_SelectedHandle->STATUS    = (Direction == ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0;
-       USB_Endpoint_SelectedHandle->CTRL      = Config;
-       USB_Endpoint_SelectedHandle->CNT       = 0;
-       USB_Endpoint_SelectedHandle->DATAPTR   = (intptr_t)&USB_Endpoint_SelectedFIFO->Data[0];
+       USB_Endpoint_SelectedHandle->CTRL    = 0;
+       USB_Endpoint_SelectedHandle->STATUS  = (Direction == ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0;
+       USB_Endpoint_SelectedHandle->CTRL    = Config;
+       USB_Endpoint_SelectedHandle->CNT     = 0;
+       USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)&USB_Endpoint_SelectedFIFO->Data[0];
        
-       USB_Endpoint_SelectedFIFO->Length      = (Direction == ENDPOINT_DIR_IN) ? Size : 0;
-       USB_Endpoint_SelectedFIFO->Position    = 0;
+       USB_Endpoint_SelectedFIFO->Length    = (Direction == ENDPOINT_DIR_IN) ? Size : 0;
+       USB_Endpoint_SelectedFIFO->Position  = 0;
 
        return true;
 }