Closed za-songguo closed 1 year ago
Hi, sorry for the late response.
When every peripheral lives in its own mutex, you still need one additional mutex guarding the bus itself to ensure mutually exclusive access to it. As it seems you are using the Mutex
from std
for your peripherals, the BusManagerStd
would be most appropriate.
However, you can also consider going a different route: You could put all peripherals into a single big mutex and then ensure exclusive access using the BusManagerAtomicCheck
. This is particularly useful for frameworks like RTIC. Check the linked documentation for more details.
Thanks for your reply. It is useful for me.
I have already wrapped my peripherals with
Arc
andMutex
, like this:(The peripherals will be shared across multiple threads.) What kind of shared bus should I use?
BusManagerSimple
orBusMutex
?