Indigresso Wiki

Open Source Stuff for DASH7

User Tools

Site Tools


opentag:otlib:ot_support_h

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

opentag:otlib:ot_support_h [2012/03/26 20:40] (current)
jpnorair created
Line 1: Line 1:
 +====== OT_support.h (OTlib) ======
 +OT_support.h contains constants describing [[opentag:​main#​coding_guidelines|officially supported]] compiler and linker settings for [[opentag:​main|OpenTag]]. ​ As a developer, you can alter OT_support.h if you are porting to some new type of compiler. ​ At the time of writing (03-2012), GCC, CL430 (TI's CC430 compiler), and IAR are supported -- there are not many others worth considering.
  
 +===== OTlib/​OT_support.h =====
 +Here is the code for OT_support.h. ​ You may also refer to the [[opentag:​doxygen|doxygen code documentation]]. ​ Note that non-EABI linkers do not have the greatest support for inline function declarations.
 +<​code>​
 +
 +// COMPILERS Officially Supported
 +#define SIM_GCC ​    0
 +#define GCC         1
 +#define GCC_ARM ​    ​1 ​      //​legacy
 +#define CL430       16
 +#define CCSv4       ​CL430 ​ //legacy
 +#define CCSv5       ​CL430 ​ //legacy
 +#define IAR_V5 ​     32
 +
 +
 +///@todo "​__GCC__"​ and "​__IARV5__"​ probably have other official definitions.
 +///      The official definitions should be appropriated ASAP.
 +
 +// GCC: Preferred Compiler
 +#if defined(__GCC__) || defined(__GNUC__)
 +#   ​define CC_SUPPORT ​  GCC
 +
 +// CL430: a GCC-variant used in TI CCS
 +#elif (defined(__CCSv4__) || defined(__CCSv5__) || defined(__CL430__))
 +#   ​define CC_SUPPORT ​  CL430
 +
 +// IAR_V5: a proprietary compiler from IAR
 +#elif (defined(__IARV5__))
 +#   ​define CC_SUPPORT ​  ​IAR_V5
 +
 +#else
 +#   error "A known, supported compiler has not been pre-defined. ​ Check OTlib/​OT_support.h"​
 +
 +#endif
 +
 +
 +
 +
 +
 +/** Inline Function Support ​ <BR>
 +  * ========================================================================<​BR>​
 +  * EABI linkers have nice support for inline functions.
 +  */
 +
 +#if (CC_SUPPORT == GCC)
 +#   ​define OT_INLINE ​   inline
 +#   ​define OT_INLINE_H ​ inline
 +
 +#elif (CC_SUPPORT == CL430)
 +#   ifdef __EABI__
 +#       ​define OT_INLINE ​   inline
 +#       ​define OT_INLINE_H ​ inline
 +#   else
 +#       ​define OT_INLINE
 +#       ​define OT_INLINE_H ​ __inline
 +#   endif
 +
 +#elif (CC_SUPPORT == IAR_V5)
 +#   ​define OT_INLINE ​   __inline
 +#   ​define OT_INLINE_H ​ __inline
 +
 +#endif
 +</​code>​
opentag/otlib/ot_support_h.txt ยท Last modified: 2012/03/26 20:40 by jpnorair