startup and ota state detection working, now wifi_ap next

This commit is contained in:
2025-09-13 20:56:11 +02:00
parent 4160202cdc
commit be3c4a5095
9 changed files with 294 additions and 225 deletions

View File

@@ -1,7 +1,8 @@
use alloc::vec::Vec;
use crate::hal::esp::Esp;
use crate::hal::rtc::{BackupHeader, RTCModuleInteraction};
use alloc::vec::Vec;
//use crate::hal::water::TankSensor;
use crate::alloc::boxed::Box;
use crate::hal::{deep_sleep, BoardInteraction, FreePeripherals, Sensor};
use crate::{
config::PlantControllerConfig,
@@ -10,9 +11,7 @@ use crate::{
use anyhow::{bail, Result};
use async_trait::async_trait;
use chrono::{DateTime, Utc};
use embedded_hal::digital::OutputPin;
use measurements::{Current, Voltage};
use crate::alloc::boxed::Box;
pub struct Initial<'a> {
//pub(crate) general_fault: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
@@ -49,7 +48,7 @@ impl RTCModuleInteraction for NoRTC {
pub(crate) fn create_initial_board(
//free_pins: FreePeripherals,
fs_mount_error: bool,
_fs_mount_error: bool,
config: PlantControllerConfig,
esp: Esp<'static>,
) -> Result<Box<dyn BoardInteraction<'static> + Send>> {
@@ -123,7 +122,7 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
bail!("Please configure board revision")
}
async fn general_fault(&mut self, enable: bool) {
async fn general_fault(&mut self, _enable: bool) {
//let _ = self.general_fault.set_state(enable.into());
}
@@ -134,7 +133,7 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
async fn set_config(&mut self, config: PlantControllerConfig) -> anyhow::Result<()> {
self.config = config;
//TODO
// self.esp.save_config(&self.config)?;
// self.esp.save_config(&self.config)?;
anyhow::Ok(())
}