add pump expander

This commit is contained in:
2025-09-23 00:26:05 +02:00
parent 5b0e2b6797
commit 1f3349c348
7 changed files with 111 additions and 124 deletions

View File

@@ -104,7 +104,7 @@ pub static TIME_ACCESS: OnceLock<Rtc> = OnceLock::new();
pub const PLANT_COUNT: usize = 8;
const TANK_MULTI_SAMPLE: usize = 11;
static I2C_DRIVER: OnceLock<
pub static I2C_DRIVER: OnceLock<
embassy_sync::blocking_mutex::Mutex<CriticalSectionRawMutex, RefCell<I2c<Blocking>>>,
> = OnceLock::new();
@@ -144,13 +144,13 @@ pub trait BoardInteraction<'a> {
async fn get_mptt_current(&mut self) -> Result<Current, FatError>;
async fn progress(&mut self, counter: u32) {
let even = counter % 2 == 0;
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);
}
}
let even = counter % 2 == 0;
let _ = self.general_fault(even.into()).await;
}
}
@@ -529,7 +529,8 @@ impl PlantHal {
// v3_hal::create_v3(free_pins, esp, config, battery_interaction, rtc_module)?
// }
BoardVersion::V4 => {
v4_hal::create_v4(free_pins, esp, config, battery_interaction, rtc_module)?
v4_hal::create_v4(free_pins, esp, config, battery_interaction, rtc_module)
.await?
}
_ => {
todo!()