You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the mutex branch for an implementation of a mutex based on critical sections. And this PR for an example that uses that mutex to share state between the main thread and an interrupt.
The advantage of implementing them using critical sections is smaller code size, faster locking and that they don't require the LDREX or STREX instructions which are not available in the Cortex-M0(+).
If you have and can afford atomics then you should probably use the parking_lot crate.
I prefer the more explicit scopes that closures provide and don't really like the release on drop mechanism because the guard can be "forgotten" using mem::forget but I'll sketch something and get back to you.
See the mutex branch for an implementation of a mutex based on critical sections. And this PR for an example that uses that mutex to share state between the main thread and an interrupt.
The advantage of implementing them using critical sections is smaller code size, faster locking and that they don't require the LDREX or STREX instructions which are not available in the Cortex-M0(+).
If you have and can afford atomics then you should probably use the parking_lot crate.
cc @thejpster
The text was updated successfully, but these errors were encountered: