#![allow(unused)]
use blackbox_logger::{GyroPidMessage, SetpointMessage};
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::watch::Watch;
const GYRO_PID_WATCH_COUNT: usize = 2;
static GYRO_PID_WATCH: Watch<CriticalSectionRawMutex, GyroPidMessage, GYRO_PID_WATCH_COUNT> = Watch::new();
pub type GyroPidMessageSender =
embassy_sync::watch::Sender<'static, CriticalSectionRawMutex, GyroPidMessage, GYRO_PID_WATCH_COUNT>;
pub fn gyro_pid_sender() -> GyroPidMessageSender {
GYRO_PID_WATCH.sender()
}
pub type GyroPidReceiver =
embassy_sync::watch::Receiver<'static, CriticalSectionRawMutex, GyroPidMessage, GYRO_PID_WATCH_COUNT>;
pub fn gyro_pid_receiver() -> GyroPidReceiver {
GYRO_PID_WATCH.receiver().expect("gyro_pid receiver failed")
}
const SETPOINT_WATCH_COUNT: usize = 2;
static SETPOINT_WATCH: Watch<CriticalSectionRawMutex, SetpointMessage, SETPOINT_WATCH_COUNT> = Watch::new();
pub type SetpointMessageSender =
embassy_sync::watch::Sender<'static, CriticalSectionRawMutex, SetpointMessage, SETPOINT_WATCH_COUNT>;
pub fn setpoint_sender() -> SetpointMessageSender {
SETPOINT_WATCH.sender()
}
pub type SetpointReceiver =
embassy_sync::watch::Receiver<'static, CriticalSectionRawMutex, SetpointMessage, SETPOINT_WATCH_COUNT>;
pub fn setpoint_receiver() -> SetpointReceiver {
SETPOINT_WATCH.receiver().expect("setpoint receiver failed")
}