fix progress display

This commit is contained in:
2025-09-23 00:43:19 +02:00
parent 1f3349c348
commit b594a02870
2 changed files with 43 additions and 3 deletions

View File

@@ -144,7 +144,7 @@ pub trait BoardInteraction<'a> {
async fn get_mptt_current(&mut self) -> Result<Current, FatError>;
async fn progress(&mut self, counter: u32) {
let current = counter / (PLANT_COUNT as u32);
let current = counter % PLANT_COUNT as u32;
for led in 0..PLANT_COUNT {
if let Err(err) = self.fault(led, current == led as u32).await {
warn!("Fault on plant {}: {:?}", led, err);
@@ -153,6 +153,15 @@ pub trait BoardInteraction<'a> {
let even = counter % 2 == 0;
let _ = self.general_fault(even.into()).await;
}
async fn clear_progress(&mut self) {
for led in 0..PLANT_COUNT {
if let Err(err) = self.fault(led, false).await {
warn!("Fault on plant {}: {:?}", led, err);
}
}
let _ = self.general_fault(false).await;
}
}
#[allow(dead_code)]