Skip to content

Commit dac52ce

Browse files
author
James Munns
committed
A couple more clarifications
1 parent 3941a77 commit dac52ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ And don't forget to check our [Awesome Embedded Rust][aer] list! The thing you a
3636

3737
### Background
3838

39-
Currently, it is not convenient to share non-atomic data with an interrupt using safe Rust. Because interrupt handlers are functions that take no arguments, all data consumed by interrupts must either be Atomic (e.g. `AtomicBool`), local `static` variables, or global or module scoped `static` variables.
39+
Currently, it is not convenient to share non-atomic or non-`Sync` data with an interrupt using safe Rust. Because interrupt handlers are functions that take no arguments, all data consumed by interrupts must either be global or module scoped Atomics (e.g. `AtomicBool`), local `static` variables, or global or module scoped `static` variables.
4040

4141
Global variables are not great in Rust, because:
4242

43-
* All mutable access must be `unsafe`
44-
* Not all data can be initialized in a `const` context, so it's often necessary to use an `Option<T>` to delay the initialization at runtime
43+
* All mutable access (of non-`Sync`/`Atomic` data) must be `unsafe`
44+
* Not all data can be initialized in a `const` context, so it's often necessary to use an `Option<T>` to delay the initialization to runtime
4545
* Global variables aren't typically idiomatic Rust.
4646

4747
Frameworks like [cortex-m-rtfm] achieve this in a zero cost fashion by using a Domain Specific Language to automatically provide safe access to shared resources between tasks and interrupts, however these tools can not be used by applications not using RTFM, or by libraries such as HAL or BSP crates.

0 commit comments

Comments
 (0)