Skip to content

Commit

Permalink
Merge pull request #1519 from gullradriel/locking-fix
Browse files Browse the repository at this point in the history
define replacement for enable and disable irq for m0
  • Loading branch information
miek authored Dec 18, 2024
2 parents cfdfe8a + 9bdf731 commit e004689
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firmware/common/locking.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
#else
static inline uint32_t load_exclusive(volatile uint32_t* addr)
{
__disable_irq();
__asm volatile("cpsid i" ::: "memory");
return *addr;
}

static inline uint32_t store_exclusive(uint32_t val, volatile uint32_t* addr)
{
*addr = val;
__enable_irq();
__asm volatile("cpsie i" ::: "memory");
return 0;
}
#endif
Expand Down

0 comments on commit e004689

Please sign in to comment.