Porting updates for the UC3B architecture - get UC3B partially enumerating using...
[pub/lufa.git] / LUFA / Drivers / USB / Core / UC3B / Endpoint_UC3B.c
index 1f5004d..ee9d35f 100644 (file)
 uint8_t USB_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;\r
 #endif\r
 \r
-uint8_t USB_SelectedEndpoint = ENDPOINT_CONTROLEP;\r
-\r
+volatile uint8_t USB_SelectedEndpoint = ENDPOINT_CONTROLEP;\r
+volatile void*   USB_EndpointFIFOPos[ENDPOINT_TOTAL_ENDPOINTS];\r
 \r
 bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,\r
-                                    const uint32_t UECFGXData)\r
+                                    const uint32_t UECFG0Data)\r
 {\r
        Endpoint_SelectEndpoint(Number);\r
        Endpoint_EnableEndpoint();\r
 \r
-       ((uint32_t*)AVR32_USBB_UECFG0)[USB_SelectedEndpoint] = 0;\r
-       ((uint32_t*)AVR32_USBB_UECFG0)[USB_SelectedEndpoint] = UECFGXData;\r
+       (&AVR32_USBB.uecfg0)[Number] = 0;\r
+       (&AVR32_USBB.uecfg0)[Number] = UECFG0Data;\r
+       USB_EndpointFIFOPos[Number] = &AVR32_USBB_SLAVE[Number * 0x10000];\r
 \r
        return Endpoint_IsConfigured();\r
 }\r
@@ -59,8 +60,9 @@ void Endpoint_ClearEndpoints(void)
        for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++)\r
        {\r
                Endpoint_SelectEndpoint(EPNum);\r
-               ((uint32_t*)AVR32_USBB_UECFG0)[USB_SelectedEndpoint]    = 0;\r
-               ((uint32_t*)AVR32_USBB_UECON0CLR)[USB_SelectedEndpoint] = 0xFFFFFFFF;\r
+               (&AVR32_USBB.uecfg0)[EPNum]    = 0;\r
+               (&AVR32_USBB.uecon0clr)[EPNum] = 0xFFFFFFFF;\r
+               USB_EndpointFIFOPos[EPNum] = &AVR32_USBB_SLAVE[EPNum * 0x10000];\r
                Endpoint_DisableEndpoint();\r
        }\r
 }\r