extract rtc module, extract tank module, fix backupview refresh, switch to embedded storage for eeprom
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::{config::TankConfig, hal::HAL};
|
||||
use anyhow::Context;
|
||||
use serde::Serialize;
|
||||
|
||||
const OPEN_TANK_VOLTAGE: f32 = 3.0;
|
||||
@@ -151,7 +152,12 @@ impl TankState {
|
||||
|
||||
pub fn determine_tank_state(board: &mut std::sync::MutexGuard<'_, HAL<'_>>) -> TankState {
|
||||
if board.board_hal.get_config().tank.tank_sensor_enabled {
|
||||
match board.board_hal.tank_sensor_voltage() {
|
||||
match board
|
||||
.board_hal
|
||||
.get_tank_sensor()
|
||||
.context("no sensor")
|
||||
.and_then(|f| f.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