mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_def.h
- Revision:
- 153:fa9ff456f731
- Parent:
- 149:156823d33999
- Child:
- 164:289d4deac6e4
--- a/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_def.h Thu Dec 15 11:48:27 2016 +0000 +++ b/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_def.h Tue Dec 20 17:27:56 2016 +0000 @@ -123,6 +123,27 @@ (__HANDLE__)->Lock = HAL_UNLOCKED; \ }while (0) #endif /* USE_RTOS */ +#if defined (__CC_ARM) +#pragma diag_suppress 3731 +#endif +static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask) +{ + uint32_t newValue; + do { + newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) | mask; + + } while (__STREXW(newValue,(volatile unsigned long*) ptr)); +} + + +static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask) +{ + uint32_t newValue; + do { + newValue = (uint32_t)__LDREXW((volatile unsigned long *)ptr) &~mask; + + } while (__STREXW(newValue,(volatile unsigned long*) ptr)); +} #if defined ( __GNUC__ ) #ifndef __weak