Add software FIFOs to the UC3B pipe control interfaces, to match the endpoint control...
[pub/lufa.git] / LUFA / Drivers / USB / Core / UC3B / Pipe_UC3B.c
index eb41143..51f4d5e 100644 (file)
@@ -36,7 +36,9 @@
 #include "../Pipe.h"\r
 \r
 uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;\r
+\r
 volatile uint8_t USB_SelectedPipe = PIPE_CONTROLPIPE;\r
+volatile void*   USB_PipeFIFOPos[PIPE_TOTAL_PIPES];\r
 \r
 bool Pipe_ConfigurePipe(const uint8_t Number,\r
                         const uint8_t Type,\r
@@ -50,10 +52,11 @@ bool Pipe_ConfigurePipe(const uint8_t Number,
 \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
-                                                          ((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET));\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
+                                       ((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET));\r
+       USB_PipeFIFOPos[PNum]        = &AVR32_USBB_SLAVE[PNum * 0x10000];\r
 \r
        Pipe_SetInfiniteINRequests();\r
 \r
@@ -67,6 +70,7 @@ void Pipe_ClearPipes(void)
                Pipe_SelectPipe(PNum);\r
                (&AVR32_USBB.upcfg0)[PNum]    = 0;\r
                (&AVR32_USBB.upcon0clr)[PNum] = 0xFFFFFFFF;\r
+               USB_PipeFIFOPos[PNum]         = &AVR32_USBB_SLAVE[EPNum * 0x10000];\r
                Pipe_DisablePipe();\r
        }\r
 }\r