cancel
Showing results for 
Search instead for 
Did you mean: 

Inline functions

greg_t
Associate II
Posted on September 29, 2010 at 21:46

Inline functions

2 REPLIES 2
Posted on May 17, 2011 at 14:09

#if defined ( __CC_ARM   )

  #define __ASM            __asm                                      /*!< asm keyword for ARM Compiler          */

  #define __INLINE         __inline                                   /*!< inline keyword for ARM Compiler       */

#elif defined ( __ICCARM__ )

  #define __ASM           __asm                                       /*!< asm keyword for IAR Compiler          */

  #define __INLINE        inline                                      /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */

#elif defined   (  __GNUC__  )

  #define __ASM            __asm                                      /*!< asm keyword for GNU Compiler          */

  #define __INLINE         inline                                     /*!< inline keyword for GNU Compiler       */

#elif defined   (  __TASKING__  )

  #define __ASM            __asm                                      /*!< asm keyword for TASKING Compiler      */

  #define __INLINE         inline                                     /*!< inline keyword for TASKING Compiler   */

#endif

static __INLINE void __enable_fault_irq()         { __ASM (''cpsie f''); }

static __INLINE void __disable_fault_irq()        { __ASM (''cpsid f''); }

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
domen23
Associate II
Posted on May 17, 2011 at 14:09

For GCC, with -O0 or -Os you might need attribute always_inline.