Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
nRF52 serial: Tighten/simplify atomics #9616
Use new atomics (exchange, load, store and bool types) to simplify
Requires preceding PR #9600.
Pull request type
I see what you mean. I was under the impression that the
It might be okay - it's only read by the interrupt handler, and it's written by the async setup code to make it respond differently. As long as it writes to it before enabling interrupts, and the interrupt enable is a memory barrier, you're fine.
But interrupt enables might not be memory barriers: patch coming for that here - ARM-software/CMSIS_5#510
I'm not really sure how much any of this is required - most HALs don't have any sort of protection in this area, and just assume you don't mix async and sync operations, or attempt overlapping async.