Rahix / shared-bus

Crate for sharing buses between multiple devices
Apache License 2.0
129 stars 34 forks source link

Add a NullMutex for sharing within a single task/thread #12

Closed Rahix closed 4 years ago

Rahix commented 4 years ago

When all peripherals using the bus live in the same thread, just the RefCell is enough; no actual Mutex type is needed. This can reduce overhead and doesn't unnecessarily block other tasks (e.g. by turning off interrupts).

cc @ryan-summers