Removed tattle tale test driver
This commit is contained in:
@ -11,7 +11,6 @@ use std::ops::Deref;
|
||||
|
||||
// Debug modules
|
||||
mod test_console;
|
||||
//mod test_driver_tattle;
|
||||
|
||||
// Release modules
|
||||
mod commands;
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
/// Listen to every command handled by dispatch, and report it to uart.
|
||||
|
||||
use log::*; //{trace, debug, info, warn, error}
|
||||
use strum::EnumCount;
|
||||
|
||||
use crate::commands::Commands;
|
||||
use crate::dispatch::Dispatch;
|
||||
use async_channel::Receiver;
|
||||
|
||||
pub fn prepare_tattle(dispatch: &mut Dispatch) -> anyhow::Result<Receiver<Commands>> {
|
||||
let cmds = vec![
|
||||
Commands::PicRecvUp,
|
||||
Commands::PicRecvDown,
|
||||
Commands::PicRecvStop,
|
||||
Commands::BluetoothUp{data: 0},
|
||||
Commands::BluetoothDown{data: 0},
|
||||
Commands::BluetoothStop{_data: 0},
|
||||
Commands::StopTimerExpired,
|
||||
Commands::StopTimerRestart,
|
||||
Commands::StopTimerClear,
|
||||
Commands::ButtonTimerExpired,
|
||||
Commands::ButtonTimerRestart,
|
||||
Commands::ButtonTimerClear,
|
||||
];
|
||||
if Commands::COUNT != cmds.len() {
|
||||
warn!("Incorrect number of commands are being tattled on. Total commands: {}, listening to {}", Commands::COUNT, cmds.len());
|
||||
}
|
||||
let r_channel = dispatch.get_callback_channel(&cmds);
|
||||
Ok(r_channel)
|
||||
}
|
||||
|
||||
pub async fn start_tattle(r_channel: Receiver<Commands>) -> anyhow::Result<()> {
|
||||
debug!("Tattle started listening to messages");
|
||||
loop {
|
||||
let msg = r_channel.recv().await?;
|
||||
debug!("Message: {:?}", msg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user