Fixed swapped Little Endian/Big Endian endpoint and pipe write code for the UC3 devices (thanks to Andrew Chu).
This commit is contained in:
parent
f235021abe
commit
35564bb1a7
5 changed files with 20 additions and 19 deletions
|
|
@ -605,8 +605,8 @@
|
|||
static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_16_LE(const uint16_t Data)
|
||||
{
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
|
||||
|
|
@ -619,8 +619,8 @@
|
|||
static inline void Endpoint_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_16_BE(const uint16_t Data)
|
||||
{
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
|
|
@ -684,10 +684,10 @@
|
|||
static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_32_LE(const uint32_t Data)
|
||||
{
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 24);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 16);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 16);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 24);
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
|
||||
|
|
@ -700,10 +700,10 @@
|
|||
static inline void Endpoint_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_32_BE(const uint32_t Data)
|
||||
{
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 16);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 24);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 16);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
|
|
|
|||
|
|
@ -515,6 +515,7 @@
|
|||
static inline void Pipe_ClearSETUP(void)
|
||||
{
|
||||
(&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].txstpic = true;
|
||||
(&AVR32_USBB.UPCON0CLR)[USB_Pipe_SelectedPipe].fifoconc = true;
|
||||
USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
|
|
@ -676,8 +677,8 @@
|
|||
static inline void Pipe_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_16_LE(const uint16_t Data)
|
||||
{
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
|
||||
|
|
@ -690,8 +691,8 @@
|
|||
static inline void Pipe_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_16_BE(const uint16_t Data)
|
||||
{
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
|
||||
|
|
@ -755,10 +756,10 @@
|
|||
static inline void Pipe_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_32_LE(const uint32_t Data)
|
||||
{
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 24);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 16);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 16);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 24);
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
|
||||
|
|
@ -771,10 +772,10 @@
|
|||
static inline void Pipe_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_32_BE(const uint32_t Data)
|
||||
{
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 16);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 24);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 16);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void USB_ResetInterface(void)
|
|||
else if (USB_CurrentMode == USB_MODE_Host)
|
||||
{
|
||||
#if defined(INVERTED_VBUS_ENABLE_LINE)
|
||||
AVR32_USBB.USBCON.vbuspol = true;
|
||||
AVR32_USBB.USBCON.vbuspo = true;
|
||||
#endif
|
||||
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue