Commit 13e2f71f authored by Dean Camera's avatar Dean Camera
Browse files

Simplify AVR32 UC3B software FIFO, as it will only ever be accessed a byte at...

Simplify AVR32 UC3B software FIFO, as it will only ever be accessed a byte at a time to prevent data alignment issues.
parent c8a438d6
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
uint8_t USB_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE; uint8_t USB_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
#endif #endif
volatile uint8_t USB_SelectedEndpoint = ENDPOINT_CONTROLEP; volatile uint8_t USB_SelectedEndpoint = ENDPOINT_CONTROLEP;
volatile void* USB_EndpointFIFOPos[ENDPOINT_TOTAL_ENDPOINTS]; volatile uint8_t* USB_EndpointFIFOPos[ENDPOINT_TOTAL_ENDPOINTS];
bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number, bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
const uint32_t UECFG0Data) const uint32_t UECFG0Data)
......
...@@ -131,8 +131,8 @@ ...@@ -131,8 +131,8 @@
const uint32_t UECFGXData); const uint32_t UECFGXData);
/* External Variables: */ /* External Variables: */
extern volatile uint8_t USB_SelectedEndpoint; extern volatile uint8_t USB_SelectedEndpoint;
extern volatile void* USB_EndpointFIFOPos[]; extern volatile uint8_t* USB_EndpointFIFOPos[];
#endif #endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
static inline uint32_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint32_t Endpoint_GetEndpointDirection(void) static inline uint32_t Endpoint_GetEndpointDirection(void)
{ {
return ((&AVR32_USBB.uecfg0)[USB_SelectedEndpoint] & AVR32_USBB_UECFG0_EPDIR_MASK) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT; return ((&AVR32_USBB.UECFG0)[USB_SelectedEndpoint].epdir ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT);
} }
/** Sets the direction of the currently selected endpoint. /** Sets the direction of the currently selected endpoint.
...@@ -605,7 +605,7 @@ ...@@ -605,7 +605,7 @@
static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_Read_Byte(void) static inline uint8_t Endpoint_Read_Byte(void)
{ {
return *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); return *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
} }
/** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints. /** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints.
...@@ -617,7 +617,7 @@ ...@@ -617,7 +617,7 @@
static inline void Endpoint_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_Byte(const uint8_t Byte) static inline void Endpoint_Write_Byte(const uint8_t Byte)
{ {
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = Byte; *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = Byte;
} }
/** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints. /** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints.
...@@ -629,7 +629,7 @@ ...@@ -629,7 +629,7 @@
{ {
uint8_t Dummy; uint8_t Dummy;
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
} }
/** Reads two bytes from the currently selected endpoint's bank in little endian format, for OUT /** Reads two bytes from the currently selected endpoint's bank in little endian format, for OUT
...@@ -642,8 +642,8 @@ ...@@ -642,8 +642,8 @@
static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint16_t Endpoint_Read_Word_LE(void) static inline uint16_t Endpoint_Read_Word_LE(void)
{ {
uint16_t Byte1 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint16_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint16_t Byte0 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint16_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
return ((Byte0 << 8) | Byte1); return ((Byte0 << 8) | Byte1);
} }
...@@ -658,8 +658,8 @@ ...@@ -658,8 +658,8 @@
static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint16_t Endpoint_Read_Word_BE(void) static inline uint16_t Endpoint_Read_Word_BE(void)
{ {
uint16_t Byte0 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint16_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint16_t Byte1 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint16_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
return ((Byte0 << 8) | Byte1); return ((Byte0 << 8) | Byte1);
} }
...@@ -674,8 +674,8 @@ ...@@ -674,8 +674,8 @@
static inline void Endpoint_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_Word_LE(const uint16_t Word) static inline void Endpoint_Write_Word_LE(const uint16_t Word)
{ {
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (Word >> 8); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word >> 8);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (Word & 0xFF); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word & 0xFF);
} }
/** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN /** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
...@@ -688,8 +688,8 @@ ...@@ -688,8 +688,8 @@
static inline void Endpoint_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_Word_BE(const uint16_t Word) static inline void Endpoint_Write_Word_BE(const uint16_t Word)
{ {
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (Word & 0xFF); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word & 0xFF);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (Word >> 8); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word >> 8);
} }
/** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints. /** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints.
...@@ -701,8 +701,8 @@ ...@@ -701,8 +701,8 @@
{ {
uint8_t Dummy; uint8_t Dummy;
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
} }
/** Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT /** Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT
...@@ -715,10 +715,10 @@ ...@@ -715,10 +715,10 @@
static inline uint32_t Endpoint_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Endpoint_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint32_t Endpoint_Read_DWord_LE(void) static inline uint32_t Endpoint_Read_DWord_LE(void)
{ {
uint32_t Byte3 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte3 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint32_t Byte2 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte2 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint32_t Byte1 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint32_t Byte0 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3); return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
} }
...@@ -733,10 +733,10 @@ ...@@ -733,10 +733,10 @@
static inline uint32_t Endpoint_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Endpoint_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint32_t Endpoint_Read_DWord_BE(void) static inline uint32_t Endpoint_Read_DWord_BE(void)
{ {
uint32_t Byte0 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint32_t Byte1 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint32_t Byte2 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte2 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
uint32_t Byte3 = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); uint32_t Byte3 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3); return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
} }
...@@ -751,10 +751,10 @@ ...@@ -751,10 +751,10 @@
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) static inline void Endpoint_Write_DWord_LE(const uint32_t DWord)
{ {
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord >> 24); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 24);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord >> 16); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 16);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord >> 8); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 8);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord & 0xFF); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord & 0xFF);
} }
/** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN /** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
...@@ -767,10 +767,10 @@ ...@@ -767,10 +767,10 @@
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) static inline void Endpoint_Write_DWord_BE(const uint32_t DWord)
{ {
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord & 0xFF); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord & 0xFF);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord >> 8); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 8);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord >> 16); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 16);
*(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++) = (DWord >> 24); *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 24);
} }
/** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints. /** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
...@@ -782,10 +782,10 @@ ...@@ -782,10 +782,10 @@
{ {
uint8_t Dummy; uint8_t Dummy;
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
Dummy = *(((volatile uint8_t** volatile)USB_EndpointFIFOPos)[USB_SelectedEndpoint]++); Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
} }
/* External Variables: */ /* External Variables: */
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE; uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
volatile uint8_t USB_SelectedPipe = PIPE_CONTROLPIPE; volatile uint8_t USB_SelectedPipe = PIPE_CONTROLPIPE;
volatile void* USB_PipeFIFOPos[PIPE_TOTAL_PIPES]; volatile uint8_t* USB_PipeFIFOPos[PIPE_TOTAL_PIPES];
bool Pipe_ConfigurePipe(const uint8_t Number, bool Pipe_ConfigurePipe(const uint8_t Number,
const uint8_t Type, const uint8_t Type,
......
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* External Variables: */ /* External Variables: */
extern volatile uint8_t USB_SelectedPipe; extern volatile uint8_t USB_SelectedPipe;
extern volatile void* USB_PipeFIFOPos[]; extern volatile uint8_t* USB_PipeFIFOPos[];
#endif #endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
...@@ -610,7 +610,7 @@ ...@@ -610,7 +610,7 @@
static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Pipe_Read_Byte(void) static inline uint8_t Pipe_Read_Byte(void)
{ {
return *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); return *(USB_PipeFIFOPos[USB_SelectedPipe]++);
} }
/** Writes one byte from the currently selected pipe's bank, for IN direction pipes. /** Writes one byte from the currently selected pipe's bank, for IN direction pipes.
...@@ -622,7 +622,7 @@ ...@@ -622,7 +622,7 @@
static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_Byte(const uint8_t Byte) static inline void Pipe_Write_Byte(const uint8_t Byte)
{ {
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = Byte; *(USB_PipeFIFOPos[USB_SelectedPipe]++) = Byte;
} }
/** Discards one byte from the currently selected pipe's bank, for OUT direction pipes. /** Discards one byte from the currently selected pipe's bank, for OUT direction pipes.
...@@ -634,7 +634,7 @@ ...@@ -634,7 +634,7 @@
{ {
uint8_t Dummy; uint8_t Dummy;
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
} }
/** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT /** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
...@@ -647,8 +647,8 @@ ...@@ -647,8 +647,8 @@
static inline uint16_t Pipe_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint16_t Pipe_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint16_t Pipe_Read_Word_LE(void) static inline uint16_t Pipe_Read_Word_LE(void)
{ {
uint16_t Byte1 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint16_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint16_t Byte0 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint16_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
return ((Byte0 << 8) | Byte1); return ((Byte0 << 8) | Byte1);
} }
...@@ -663,8 +663,8 @@ ...@@ -663,8 +663,8 @@
static inline uint16_t Pipe_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint16_t Pipe_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint16_t Pipe_Read_Word_BE(void) static inline uint16_t Pipe_Read_Word_BE(void)
{ {
uint16_t Byte0 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint16_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint16_t Byte1 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint16_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
return ((Byte0 << 8) | Byte1); return ((Byte0 << 8) | Byte1);
} }
...@@ -679,8 +679,8 @@ ...@@ -679,8 +679,8 @@
static inline void Pipe_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_Word_LE(const uint16_t Word) static inline void Pipe_Write_Word_LE(const uint16_t Word)
{ {
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (Word >> 8); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word >> 8);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (Word & 0xFF); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word & 0xFF);
} }
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN /** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
...@@ -693,8 +693,8 @@ ...@@ -693,8 +693,8 @@
static inline void Pipe_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_Word_BE(const uint16_t Word) static inline void Pipe_Write_Word_BE(const uint16_t Word)
{ {
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (Word & 0xFF); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word & 0xFF);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (Word >> 8); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word >> 8);
} }
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes. /** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
...@@ -706,8 +706,8 @@ ...@@ -706,8 +706,8 @@
{ {
uint8_t Dummy; uint8_t Dummy;
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
} }
/** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT /** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT
...@@ -720,10 +720,10 @@ ...@@ -720,10 +720,10 @@
static inline uint32_t Pipe_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Pipe_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint32_t Pipe_Read_DWord_LE(void) static inline uint32_t Pipe_Read_DWord_LE(void)
{ {
uint32_t Byte3 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte3 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint32_t Byte2 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte2 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint32_t Byte1 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint32_t Byte0 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3); return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
} }
...@@ -738,10 +738,10 @@ ...@@ -738,10 +738,10 @@
static inline uint32_t Pipe_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Pipe_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint32_t Pipe_Read_DWord_BE(void) static inline uint32_t Pipe_Read_DWord_BE(void)
{ {
uint32_t Byte0 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint32_t Byte1 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint32_t Byte2 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte2 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
uint32_t Byte3 = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); uint32_t Byte3 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3); return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
} }
...@@ -756,10 +756,10 @@ ...@@ -756,10 +756,10 @@
static inline void Pipe_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_DWord_LE(const uint32_t DWord) static inline void Pipe_Write_DWord_LE(const uint32_t DWord)
{ {
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord >> 24); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 24);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord >> 16); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 16);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord >> 8); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 8);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord & 0xFF); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord & 0xFF);
} }
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN /** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
...@@ -772,10 +772,10 @@ ...@@ -772,10 +772,10 @@
static inline void Pipe_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_DWord_BE(const uint32_t DWord) static inline void Pipe_Write_DWord_BE(const uint32_t DWord)
{ {
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord & 0xFF); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord & 0xFF);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord >> 8); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 8);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord >> 16); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 16);
*(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++) = (DWord >> 24); *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 24);
} }
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes. /** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
...@@ -787,10 +787,10 @@ ...@@ -787,10 +787,10 @@
{ {
uint8_t Dummy; uint8_t Dummy;
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
Dummy = *(((volatile uint8_t** volatile)USB_PipeFIFOPos)[USB_SelectedPipe]++); Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
} }
/* External Variables: */ /* External Variables: */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment