Skip to main content
greg_t
Associate III
September 29, 2010
Question

Inline functions

Posted on September 29, 2010 at 21:46

Inline functions

    This topic has been closed for replies.

    2 replies

    domen23
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 14:09

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

    Tesla DeLorean
    Guru
    May 17, 2011
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..