combine all branches

This commit is contained in:
2025-06-19 13:05:47 +02:00
parent 751f07e6fd
commit e2cce88390
9 changed files with 939 additions and 909 deletions

View File

@@ -1,7 +1,8 @@
//offer ota and config mode
use crate::hal::battery::BatteryInteraction;
use crate::{
determine_tank_state, get_version, log::LogMessage, plant_hal::PLANT_COUNT,
determine_tank_state, get_version, log::LogMessage,
plant_state::PlantState, BOARD_ACCESS,
};
use anyhow::bail;
@@ -20,7 +21,7 @@ use std::{
use url::Url;
use crate::config::PlantControllerConfig;
use crate::plant_hal::BoardInteraction;
use crate::hal::{BoardInteraction, PLANT_COUNT};
use crate::plant_state::MoistureSensorState;
#[derive(Serialize, Debug)]
@@ -228,7 +229,7 @@ fn get_battery_state(
_request: &mut Request<&mut EspHttpConnection>,
) -> Result<Option<std::string::String>, anyhow::Error> {
let mut board = BOARD_ACCESS.lock().unwrap();
let battery_state = board.get_battery_state();
let battery_state = board.battery_monitor.get_battery_state();
let battery_json = serde_json::to_string(&battery_state)?;
anyhow::Ok(Some(battery_json))
}
@@ -322,7 +323,7 @@ fn ota(
total_read += read;
let to_write = &buffer[0..read];
//delay for watchdog and wifi stuff
Delay::new_default().delay_ms(1);
board.esp.delay.delay_ms(1);
let iter = (total_read / 1024) % 8;
if iter != lastiter {