mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
#1805 fix merge issue in pico_atomic which ended up with using IRQ disble instead of spin lock (#1838)
This commit is contained in:
parent
b271208071
commit
62df126ad5
1 changed files with 2 additions and 5 deletions
|
|
@ -12,14 +12,11 @@
|
|||
#define memcmp __builtin_memcmp
|
||||
|
||||
static inline uint32_t atomic_lock(__unused const volatile void *ptr) {
|
||||
uint32_t save = save_and_disable_interrupts();
|
||||
// __dmb(); not necessary on RP2040
|
||||
return save;
|
||||
return spin_lock_blocking(spin_lock_instance(PICO_SPINLOCK_ID_ATOMIC));
|
||||
}
|
||||
|
||||
static inline void atomic_unlock(__unused const volatile void *ptr, uint32_t save) {
|
||||
// __dmb(); not necessary on RP2040
|
||||
restore_interrupts_from_disabled(save);
|
||||
spin_unlock(spin_lock_instance(PICO_SPINLOCK_ID_ATOMIC), save);
|
||||
}
|
||||
|
||||
#if PICO_C_COMPILER_IS_GNU
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue