2010-09-29 12:46 PM
Inline functions
2011-05-17 05:09 AM
#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''); }2011-05-17 05:09 AM
For GCC, with -O0 or -Os you might need attribute always_inline.