Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}


static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}

#if defined ( __GNUC__ ) && !defined ( __CC_ARM )
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}

// MBED patch
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}

// MBED patch
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}


static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}
/* MBED */

Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}


static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}

#if defined ( __GNUC__ ) && !defined ( __CC_ARM )
Expand Down
8 changes: 4 additions & 4 deletions targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ static inline void atomic_set_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) | mask;
newValue = (uint32_t)__LDREXW(ptr) | mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}

// Added for MBED PR #3062
static inline void atomic_clr_u32(volatile uint32_t *ptr, uint32_t mask)
{
uint32_t newValue;
do {
newValue = (uint32_t)__LDREXW((volatile uint32_t *)ptr) &~mask;
newValue = (uint32_t)__LDREXW(ptr) &~mask;

} while (__STREXW(newValue,(volatile uint32_t *) ptr));
} while (__STREXW(newValue, ptr));
}

#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
Expand Down