change endian conversion to native to be & be to native
completely deferred xfer isr event to usbd task complete read10, write10 sequence for large data transfer
This commit is contained in:
		@@ -107,8 +107,8 @@
 | 
			
		||||
#define U32_TO_U8S_BE(u32) U32_B1_U8(u32), U32_B2_U8(u32), U32_B3_U8(u32), U32_B4_U8(u32)
 | 
			
		||||
#define U32_TO_U8S_LE(u32) U32_B4_U8(u32), U32_B3_U8(u32), U32_B2_U8(u32), U32_B1_U8(u32)
 | 
			
		||||
 | 
			
		||||
#define __h2be_16(u16)  ((uint16_t) ((U16_LOW_U8(u16) << 8) | U16_HIGH_U8(u16)) ) // TODO refractor later
 | 
			
		||||
#define __be2h_16(u16)  __h2be_16(u16)
 | 
			
		||||
#define __n2be_16(u16)  ((uint16_t) ((U16_LOW_U8(u16) << 8) | U16_HIGH_U8(u16)) ) // TODO refractor later
 | 
			
		||||
#define __be2n_16(u16)  __n2be_16(u16)
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// INLINE FUNCTION
 | 
			
		||||
@@ -180,6 +180,12 @@ static inline uint32_t max32_of(uint32_t x, uint32_t y)
 | 
			
		||||
  return (x > y) ? x : y;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline uint16_t max16_of(uint16_t x, uint16_t y) ATTR_ALWAYS_INLINE ATTR_CONST;
 | 
			
		||||
static inline uint16_t max16_of(uint16_t x, uint16_t y)
 | 
			
		||||
{
 | 
			
		||||
  return (x > y) ? x : y;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//------------- Align -------------//
 | 
			
		||||
static inline uint32_t align32 (uint32_t value) ATTR_ALWAYS_INLINE ATTR_CONST;
 | 
			
		||||
static inline uint32_t align32 (uint32_t value)
 | 
			
		||||
 
 | 
			
		||||
@@ -130,9 +130,9 @@
 | 
			
		||||
*  @{
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
// built-in function to convert 32-bit Big-Endian to Little-Endian
 | 
			
		||||
#define __be2le   __builtin_bswap32
 | 
			
		||||
#define __le2be   __be2le
 | 
			
		||||
// built-in function to convert 32-bit from native to Big Endian
 | 
			
		||||
#define __be2n   __builtin_bswap32
 | 
			
		||||
#define __n2be   __be2n
 | 
			
		||||
 | 
			
		||||
//#define __le2be_16   __builtin_bswap16
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -82,8 +82,8 @@
 | 
			
		||||
#define ATTR_UNUSED
 | 
			
		||||
 | 
			
		||||
// built-in function to convert 32-bit Big-Endian to Little-Endian
 | 
			
		||||
#define __be2le   __REV
 | 
			
		||||
#define __le2be   __be2le
 | 
			
		||||
#define __be2n   __REV
 | 
			
		||||
#define __n2be   __be2n
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user