events: finally drop the whole bus garage idea
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, pubsub::PubSubChannel};
|
||||
use embassy_time::Duration;
|
||||
use enum_map::Enum;
|
||||
use enumset::EnumSetType;
|
||||
@@ -67,26 +66,6 @@ pub enum Prediction {
|
||||
SetPersonality(Personality)
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Notification {
|
||||
// The prediction engine has decided the UI should switch to another scene
|
||||
SceneChange(Scene),
|
||||
|
||||
// States of external connections to the world
|
||||
SensorStatus(SensorSource, SensorState),
|
||||
// The prediction engine has decided that the system should be woken up and begin running again
|
||||
WakeUp,
|
||||
// The prediction engine has decided that the system is inactive enough and it should go to low-power sleep
|
||||
Sleep,
|
||||
|
||||
// FIXME: Sor safety purposes, we probably want these two events to be combined and act atomic; if the safety lights are ever on, they should both be on.
|
||||
SetHeadlight(bool),
|
||||
SetBrakelight(bool),
|
||||
|
||||
// TODO: BPM detection via bluetooth
|
||||
Beat,
|
||||
}
|
||||
|
||||
// GPS data = 2, motion data = 1
|
||||
#[derive(Debug, EnumSetType, Enum)]
|
||||
pub enum SensorSource {
|
||||
@@ -116,19 +95,4 @@ impl From<StreamType> for SensorSource {
|
||||
StreamType::IMU => Self::IMU
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BusGarage {
|
||||
pub notify: PubSubChannel<NoopRawMutex, Notification, 5, 2, 4>,
|
||||
pub predict: PubSubChannel<NoopRawMutex, Prediction, 15, 3, 3>,
|
||||
}
|
||||
|
||||
impl Default for BusGarage {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
notify: PubSubChannel::new(),
|
||||
predict: PubSubChannel::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user