em_common.h

Go to the documentation of this file.
00001 /***************************************************************************/
00034 #ifndef __SILICON_LABS_EM_COMMON_H_
00035 #define __SILICON_LABS_EM_COMMON_H_
00036 
00037 #include <stdint.h>
00038 #include <stdbool.h>
00039 
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 /***************************************************************************/
00050 /***************************************************************************/
00056 #if !defined(__GNUC__)
00057 
00059 #define EFM32_MIN(a, b)    ((a) < (b) ? (a) : (b))
00060 
00061 #define EFM32_MAX(a, b)    ((a) > (b) ? (a) : (b))
00062 
00064 #define STRINGIZE(X) #X
00065 #define EFM32_PACK_START(X) _Pragma( STRINGIZE( pack( X ) ) )
00066 #define EFM32_PACK_END()    _Pragma( "pack()" )
00067 #define __attribute__(...)
00068 
00069 #ifdef __CC_ARM
00070 
00071 #define EFM32_ALIGN(X) __align(X)
00072 #endif
00073 #ifdef __ICCARM__
00074 
00075 #define EFM32_ALIGN(X) _Pragma( STRINGIZE( data_alignment=X ) )
00076 #endif
00077 
00078 #else
00079 
00081 #define EFM32_MIN(a, b)    ({ __typeof__(a) _a = (a); __typeof__(b) _b = (b); _a < _b ? _a : _b; })
00082 
00083 #define EFM32_MAX(a, b)    ({ __typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b; })
00084 
00090 #define EFM32_PACK_START( x )
00091 
00097 #define EFM32_PACK_END()
00098 
00105 #define EFM32_ALIGN(X)
00106 
00107 #endif
00108 
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115 
00116 #endif /* __SILICON_LABS_EM_COMMON_H_ */