diff --git a/libcpu/arm/common/atomic_arm.c b/libcpu/arm/common/atomic_arm.c index 290d72e717..e9f1d4465b 100644 --- a/libcpu/arm/common/atomic_arm.c +++ b/libcpu/arm/common/atomic_arm.c @@ -12,6 +12,7 @@ #if defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */ #include +#include #endif /** \brief LDR Exclusive (32 bit) @@ -30,7 +31,7 @@ #elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */ _Pragma("inline=forced") __intrinsic rt_atomic_t __LDREXW(volatile rt_atomic_t *ptr) { - return __LDREX((unsigned int *)ptr); + return __iar_builtin_LDREX((volatile unsigned int *)ptr); } #elif defined (__GNUC__) /* GNU GCC Compiler */ __attribute__((always_inline)) static inline rt_atomic_t __LDREXW(volatile rt_atomic_t *addr)