#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
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
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