Refactor async logging to synchronous; improve error handling consistency across modules.
This commit is contained in:
@@ -350,8 +350,7 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
|
||||
}
|
||||
Some(pump_ina) => {
|
||||
let raw = pump_ina.shunt_voltage()?;
|
||||
let shunt_voltage =
|
||||
Voltage::from_microvolts(raw.shunt_voltage_uv().abs() as f64);
|
||||
let shunt_voltage = Voltage::from_microvolts(raw.shunt_voltage_uv().abs() as f64);
|
||||
let shut_value = Resistance::from_ohms(0.05_f64);
|
||||
let current = shunt_voltage.as_volts() / shut_value.as_ohms();
|
||||
Ok(Current::from_amperes(current))
|
||||
@@ -516,8 +515,7 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
|
||||
for plant in 0..PLANT_COUNT {
|
||||
let a = moisture.sensor_a_hz[plant].unwrap_or(0.0) as u32;
|
||||
let b = moisture.sensor_b_hz[plant].unwrap_or(0.0) as u32;
|
||||
log(LogMessage::TestSensor, a, b, &(plant + 1).to_string(), "")
|
||||
.await;
|
||||
log(LogMessage::TestSensor, a, b, &(plant + 1).to_string(), "");
|
||||
}
|
||||
Timer::after_millis(10).await;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user