adjustments

This commit is contained in:
2023-12-04 00:41:29 +01:00
parent 4a8fffb3cc
commit f0f0e9f27e
2 changed files with 23 additions and 9 deletions

View File

@@ -1,12 +1,14 @@
mod config;
//mod config;
use embedded_svc::wifi::{Configuration, ClientConfiguration, AuthMethod};
use esp_idf_svc::eventloop::EspSystemEventLoop;
use esp_idf_svc::nvs::EspDefaultNvsPartition;
use esp_idf_svc::wifi::EspWifi;
use std::fs::File;
use std::io::Read;
use std::sync::Mutex;
use anyhow::{Context, Result, bail};
use anyhow::{Context, Result, bail, Ok};
use anyhow::anyhow;
use chrono::{Utc, NaiveDateTime, DateTime};
@@ -26,6 +28,8 @@ use shift_register_driver::sipo::ShiftRegister40;
use esp_idf_hal::gpio::{PinDriver, Gpio39, Gpio4, AnyInputPin};
use esp_idf_hal::prelude::Peripherals;
use crate::config;
pub const PLANT_COUNT:usize = 8;
const PINS_PER_PLANT:usize = 5;
const PLANT_PUMP_OFFSET:usize = 0;
@@ -97,7 +101,7 @@ pub trait PlantCtrlBoardInteraction{
//keep state during deepsleep
fn fault(&self,plant:usize, enable:bool);
fn get_config(&mut self) -> Result<Config>;
fn get_config(&mut self) -> Result<config::Config>;
}
pub trait CreatePlantHal<'a> {
@@ -442,7 +446,10 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
}
fn get_config(&mut self) -> Result<config::Config> {
todo!()
let config_file = File::open("config.cfg")?;
//serde_json::from_str(&data);
bail!("Not implemented");
}