tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
compiler_iar.h
Go to the documentation of this file.
1 /**************************************************************************/
37 /**************************************************************************/
38 
48 #ifndef _TUSB_COMPILER_IAR_H_
49 #define _TUSB_COMPILER_IAR_H_
50 
51 #ifdef __cplusplus
52  extern "C" {
53 #endif
54 
55 #define ALIGN_OF(x) __ALIGNOF__(x)
56 
57 #define ATTR_PACKED_STRUCT(x) __packed x
58 #define ATTR_PREPACKED __packed
59 #define ATTR_PACKED
60 //#define ATTR_SECTION(section) _Pragma((#section))
61 
62 #define ATTR_ALIGNED(bytes) _Pragma(XSTRING_(data_alignment=##bytes))
63 
64 #ifndef ATTR_ALWAYS_INLINE
65 #define ATTR_ALWAYS_INLINE error
67 #endif
68 
69 #define ATTR_PURE // TODO IAR pure function attribute
70 #define ATTR_CONST // TODO IAR const function attribute
71 #define ATTR_WEAK __weak
72 
73 #define ATTR_WARN_UNUSED_RESULT
74 #define ATTR_USED
75 #define ATTR_UNUSED
76 
77 // built-in function to convert 32-bit Big-Endian to Little-Endian
78 //#if __LITTLE_ENDIAN__
79 #define __be2n __REV
80 #define __n2be __be2n
81 
82 #define __n2be_16(u16) ((uint16_t) __REV16(u16))
83 #define __be2n_16(u16) __n2be_16(u16)
84 
85 #ifdef __cplusplus
86  }
87 #endif
88 
89 #endif /* _TUSB_COMPILER_IAR_H_ */
90