Porting updates for the UC3B architecture - get UC3B partially enumerating using...
[pub/lufa.git] / LUFA / Drivers / USB / Core / UC3B / Pipe_UC3B.c
index 9d9c600..eb41143 100644 (file)
@@ -36,7 +36,7 @@
 #include "../Pipe.h"\r
 \r
 uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;\r
-uint8_t USB_SelectedPipe    = PIPE_CONTROLPIPE;\r
+volatile uint8_t USB_SelectedPipe = PIPE_CONTROLPIPE;\r
 \r
 bool Pipe_ConfigurePipe(const uint8_t Number,\r
                         const uint8_t Type,\r
@@ -48,8 +48,8 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
        Pipe_SelectPipe(Number);\r
        Pipe_EnablePipe();\r
 \r
-       ((uint32_t*)AVR32_USBB_UPCFG0)[USB_SelectedPipe] = 0;\r
-       ((uint32_t*)AVR32_USBB_UPCFG0)[USB_SelectedPipe] = (AVR32_USBB_ALLOC_MASK |\r
+       (&AVR32_USBB.upcfg0)[Number] = 0;\r
+       (&AVR32_USBB.upcfg0)[Number] = (AVR32_USBB_ALLOC_MASK |\r
                                                           ((uint32_t)Type  << AVR32_USBB_PTYPE_OFFSET)  |\r
                                                           ((uint32_t)Token << AVR32_USBB_PTOKEN_OFFSET) |\r
                                                           ((uint32_t)Banks << AVR32_USBB_PBK_OFFSET)    |\r
@@ -65,8 +65,8 @@ void Pipe_ClearPipes(void)
        for (uint8_t PNum = 0; PNum < PIPE_TOTAL_PIPES; PNum++)\r
        {\r
                Pipe_SelectPipe(PNum);\r
-               ((uint32_t*)AVR32_USBB_UPCFG0)[USB_SelectedPipe]    = 0;\r
-               ((uint32_t*)AVR32_USBB_UPCON0CLR)[USB_SelectedPipe] = 0xFFFFFFFF;\r
+               (&AVR32_USBB.upcfg0)[PNum]    = 0;\r
+               (&AVR32_USBB.upcon0clr)[PNum] = 0xFFFFFFFF;\r
                Pipe_DisablePipe();\r
        }\r
 }\r