allow startup with initial board mode and nearly no pin configs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::config::TankConfig;
|
||||
use crate::plant_hal::{BoardInteraction, HAL};
|
||||
use crate::config::{PlantControllerConfig, TankConfig};
|
||||
|
||||
const OPEN_TANK_VOLTAGE: f32 = 3.0;
|
||||
pub const WATER_FROZEN_THRESH: f32 = 4.0;
|
||||
@@ -156,10 +156,9 @@ impl TankState {
|
||||
}
|
||||
|
||||
pub fn determine_tank_state(
|
||||
board: &mut std::sync::MutexGuard<'_, HAL<'_>>,
|
||||
config: &PlantControllerConfig,
|
||||
board: &mut std::sync::MutexGuard<'_, HAL<'_>>
|
||||
) -> TankState {
|
||||
if config.tank.tank_sensor_enabled {
|
||||
if board.config.tank.tank_sensor_enabled {
|
||||
match board.tank_sensor_voltage() {
|
||||
Ok(raw_sensor_value_mv) => TankState::Present(raw_sensor_value_mv),
|
||||
Err(err) => TankState::Error(TankError::BoardError(err.to_string())),
|
||||
|
||||
Reference in New Issue
Block a user