extract rtc module, extract tank module, fix backupview refresh, switch to embedded storage for eeprom

This commit is contained in:
2025-06-25 01:18:36 +02:00
parent 5fb8705d9a
commit 6b711e29fc
14 changed files with 851 additions and 869 deletions

View File

@@ -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())),
}