events: rewrite some event buses to use multi-consumer pubsub instead of single-consumer channels
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
|
||||
use core::sync::atomic::{AtomicBool, AtomicU8};
|
||||
|
||||
use embassy_sync::{blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}, channel::Channel, signal::Signal};
|
||||
use embassy_sync::{blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}, channel::Channel, pubsub::PubSubChannel};
|
||||
use embassy_time::Duration;
|
||||
use nalgebra::{Vector2, Vector3};
|
||||
use alloc::sync::Arc;
|
||||
@@ -133,7 +131,7 @@ impl Default for DisplayControls {
|
||||
#[derive(Debug)]
|
||||
pub struct BusGarage {
|
||||
pub motion: Channel<NoopRawMutex, Measurement, 5>,
|
||||
pub notify: Channel<CriticalSectionRawMutex, Notification, 5>,
|
||||
pub notify: PubSubChannel<CriticalSectionRawMutex, Notification, 5, 2, 4>,
|
||||
pub predict: Channel<CriticalSectionRawMutex, Prediction, 15>,
|
||||
pub display: Arc<DisplayControls>
|
||||
}
|
||||
@@ -142,7 +140,7 @@ impl Default for BusGarage {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
motion: Channel::new(),
|
||||
notify: Channel::new(),
|
||||
notify: PubSubChannel::new(),
|
||||
predict: Channel::new(),
|
||||
display: Default::default()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user