main: prettify the sensor status line
This commit is contained in:
@@ -351,8 +351,6 @@ async fn print_sensor_readings(mut events: DynSubscriber<'static, Measurement>)
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn print_sensor_status(mut events: DynSubscriber<'static, Prediction>) {
|
||||
|
||||
info!("telemetry ready");
|
||||
let mut sensor_states: EnumMap<SensorSource, SensorState> = EnumMap::default();
|
||||
loop {
|
||||
let next = events.next_message_pure().with_timeout(Duration::from_secs(5)).await;
|
||||
@@ -362,10 +360,10 @@ async fn print_sensor_status(mut events: DynSubscriber<'static, Prediction>) {
|
||||
let mut report_str = String::new();
|
||||
for (sensor, state) in &sensor_states {
|
||||
let state_icon = match state {
|
||||
SensorState::AcquiringFix => "?",
|
||||
SensorState::Degraded => "-",
|
||||
SensorState::Offline => "X",
|
||||
SensorState::Online => "O"
|
||||
SensorState::AcquiringFix => "⏱",
|
||||
SensorState::Degraded => "!",
|
||||
SensorState::Offline => "✗",
|
||||
SensorState::Online => "✔"
|
||||
};
|
||||
report_str += alloc::format!("{sensor:?}={state_icon} ").as_str();
|
||||
}
|
||||
@@ -375,10 +373,10 @@ async fn print_sensor_status(mut events: DynSubscriber<'static, Prediction>) {
|
||||
let mut report_str = String::new();
|
||||
for (sensor, state) in &sensor_states {
|
||||
let state_icon = match state {
|
||||
SensorState::AcquiringFix => "?",
|
||||
SensorState::Degraded => "-",
|
||||
SensorState::Offline => "X",
|
||||
SensorState::Online => "O"
|
||||
SensorState::AcquiringFix => "⏱",
|
||||
SensorState::Degraded => "!",
|
||||
SensorState::Offline => "✗",
|
||||
SensorState::Online => "✔"
|
||||
};
|
||||
report_str += alloc::format!("{sensor:?}={state_icon} ").as_str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user