it's alive
This commit is contained in:
@@ -2,55 +2,33 @@ pub(crate) mod battery;
|
||||
mod esp;
|
||||
mod initial_hal;
|
||||
mod rtc;
|
||||
mod v3_hal;
|
||||
mod v4_hal;
|
||||
mod v4_sensor;
|
||||
mod water;
|
||||
//mod water;
|
||||
|
||||
use crate::alloc::string::ToString;
|
||||
use crate::hal::rtc::{DS3231Module, RTCModuleInteraction};
|
||||
use crate::hal::water::TankSensor;
|
||||
use crate::hal::rtc::{RTCModuleInteraction};
|
||||
//use crate::hal::water::TankSensor;
|
||||
use crate::{
|
||||
config::{BatteryBoardVersion, BoardVersion, PlantControllerConfig},
|
||||
hal::{
|
||||
battery::{print_battery_bq34z100, BatteryInteraction, NoBatteryMonitor},
|
||||
battery::{BatteryInteraction, NoBatteryMonitor},
|
||||
esp::Esp,
|
||||
},
|
||||
log::{log, LogMessage},
|
||||
};
|
||||
use alloc::boxed::Box;
|
||||
use alloc::format;
|
||||
use core::marker::PhantomData;
|
||||
use anyhow::{Ok, Result};
|
||||
use async_trait::async_trait;
|
||||
use battery::BQ34Z100G1;
|
||||
//use battery::BQ34Z100G1;
|
||||
use bq34z100::Bq34z100g1Driver;
|
||||
use ds323x::{DateTimeAccess, Ds323x};
|
||||
use eeprom24x::{Eeprom24x, SlaveAddr, Storage};
|
||||
use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex};
|
||||
use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex};
|
||||
use embassy_sync::mutex::Mutex;
|
||||
use embassy_sync::{LazyLock, Mutex};
|
||||
use embedded_hal_bus::i2c::MutexDevice;
|
||||
use esp_idf_hal::can::CAN;
|
||||
use esp_idf_hal::pcnt::PCNT1;
|
||||
use esp_idf_hal::{
|
||||
adc::ADC1,
|
||||
delay::Delay,
|
||||
gpio::{
|
||||
Gpio0, Gpio1, Gpio10, Gpio11, Gpio12, Gpio13, Gpio14, Gpio15, Gpio16, Gpio17, Gpio18,
|
||||
Gpio2, Gpio21, Gpio22, Gpio23, Gpio24, Gpio25, Gpio26, Gpio27, Gpio28, Gpio29, Gpio3,
|
||||
Gpio30, Gpio4, Gpio5, Gpio6, Gpio7, Gpio8, IOPin, PinDriver, Pull,
|
||||
},
|
||||
i2c::{APBTickType, I2cConfig, I2cDriver},
|
||||
pcnt::PCNT0,
|
||||
prelude::Peripherals,
|
||||
reset::ResetReason,
|
||||
units::FromValueType,
|
||||
};
|
||||
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition, wifi::EspWifi};
|
||||
use esp_idf_sys::{
|
||||
esp_deep_sleep, esp_restart, esp_sleep_enable_ext1_wakeup,
|
||||
esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW,
|
||||
};
|
||||
use esp_ota::mark_app_valid;
|
||||
use embassy_sync::lazy_lock::LazyLock;
|
||||
use esp_hal::clock::CpuClock;
|
||||
use esp_hal::timer::systimer::SystemTimer;
|
||||
use measurements::{Current, Voltage};
|
||||
|
||||
//Only support for 8 right now!
|
||||
@@ -58,24 +36,27 @@ pub const PLANT_COUNT: usize = 8;
|
||||
|
||||
const TANK_MULTI_SAMPLE: usize = 11;
|
||||
|
||||
pub static I2C_DRIVER: LazyLock<Mutex<I2cDriver<'static>>> = LazyLock::new(PlantHal::create_i2c);
|
||||
//pub static I2C_DRIVER: LazyLock<Mutex<CriticalSectionRawMutex,I2cDriver<'static>>> = LazyLock::new(PlantHal::create_i2c);
|
||||
|
||||
fn deep_sleep(duration_in_ms: u64) -> ! {
|
||||
unsafe {
|
||||
//if we don't do this here, we might just revert newly flashed firmware
|
||||
mark_app_valid();
|
||||
//allow early wakeup by pressing the boot button
|
||||
if duration_in_ms == 0 {
|
||||
esp_restart();
|
||||
} else {
|
||||
//configure gpio 1 to wakeup on low, reused boot button for this
|
||||
esp_sleep_enable_ext1_wakeup(
|
||||
0b10u64,
|
||||
esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW,
|
||||
);
|
||||
esp_deep_sleep(duration_in_ms);
|
||||
//unsafe {
|
||||
// //if we don't do this here, we might just revert newly flashed firmware
|
||||
// mark_app_valid();
|
||||
// //allow early wakeup by pressing the boot button
|
||||
// if duration_in_ms == 0 {
|
||||
// esp_restart();
|
||||
// } else {
|
||||
// //configure gpio 1 to wakeup on low, reused boot button for this
|
||||
// esp_sleep_enable_ext1_wakeup(
|
||||
// 0b10u64,
|
||||
// esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW,
|
||||
// );
|
||||
// esp_deep_sleep(duration_in_ms);
|
||||
// }
|
||||
loop {
|
||||
todo!()
|
||||
}
|
||||
};
|
||||
//};
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -92,7 +73,7 @@ pub struct HAL<'a> {
|
||||
|
||||
#[async_trait]
|
||||
pub trait BoardInteraction<'a> {
|
||||
fn get_tank_sensor(&mut self) -> Option<&mut TankSensor>;
|
||||
//fn get_tank_sensor(&mut self) -> Option<&mut TankSensor>;
|
||||
fn get_esp(&mut self) -> &mut Esp<'a>;
|
||||
fn get_config(&mut self) -> &PlantControllerConfig;
|
||||
fn get_battery_monitor(&mut self) -> &mut Box<dyn BatteryInteraction + Send>;
|
||||
@@ -114,13 +95,14 @@ pub trait BoardInteraction<'a> {
|
||||
async fn get_mptt_current(&mut self) -> anyhow::Result<Current>;
|
||||
}
|
||||
|
||||
|
||||
impl dyn BoardInteraction<'_> {
|
||||
//the counter is just some arbitrary number that increases whenever some progress was made, try to keep the updates < 10 per second for ux reasons
|
||||
async fn _progress(&mut self, counter: u32) {
|
||||
let even = counter % 2 == 0;
|
||||
let current = counter / (PLANT_COUNT as u32);
|
||||
for led in 0..PLANT_COUNT {
|
||||
self.fault(led, current == led as u32).unwrap();
|
||||
self.fault(led, current == led as u32).await.unwrap();
|
||||
}
|
||||
let _ = self.general_fault(even.into());
|
||||
}
|
||||
@@ -128,134 +110,138 @@ impl dyn BoardInteraction<'_> {
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct FreePeripherals {
|
||||
pub gpio0: Gpio0,
|
||||
pub gpio1: Gpio1,
|
||||
pub gpio2: Gpio2,
|
||||
pub gpio3: Gpio3,
|
||||
pub gpio4: Gpio4,
|
||||
pub gpio5: Gpio5,
|
||||
pub gpio6: Gpio6,
|
||||
pub gpio7: Gpio7,
|
||||
pub gpio8: Gpio8,
|
||||
//config button here
|
||||
pub gpio10: Gpio10,
|
||||
pub gpio11: Gpio11,
|
||||
pub gpio12: Gpio12,
|
||||
pub gpio13: Gpio13,
|
||||
pub gpio14: Gpio14,
|
||||
pub gpio15: Gpio15,
|
||||
pub gpio16: Gpio16,
|
||||
pub gpio17: Gpio17,
|
||||
pub gpio18: Gpio18,
|
||||
//i2c here
|
||||
pub gpio21: Gpio21,
|
||||
pub gpio22: Gpio22,
|
||||
pub gpio23: Gpio23,
|
||||
pub gpio24: Gpio24,
|
||||
pub gpio25: Gpio25,
|
||||
pub gpio26: Gpio26,
|
||||
pub gpio27: Gpio27,
|
||||
pub gpio28: Gpio28,
|
||||
pub gpio29: Gpio29,
|
||||
pub gpio30: Gpio30,
|
||||
pub pcnt0: PCNT0,
|
||||
pub pcnt1: PCNT1,
|
||||
pub adc1: ADC1,
|
||||
pub can: CAN,
|
||||
// pub gpio0: Gpio0,
|
||||
// pub gpio1: Gpio1,
|
||||
// pub gpio2: Gpio2,
|
||||
// pub gpio3: Gpio3,
|
||||
// pub gpio4: Gpio4,
|
||||
// pub gpio5: Gpio5,
|
||||
// pub gpio6: Gpio6,
|
||||
// pub gpio7: Gpio7,
|
||||
// pub gpio8: Gpio8,
|
||||
// //config button here
|
||||
// pub gpio10: Gpio10,
|
||||
// pub gpio11: Gpio11,
|
||||
// pub gpio12: Gpio12,
|
||||
// pub gpio13: Gpio13,
|
||||
// pub gpio14: Gpio14,
|
||||
// pub gpio15: Gpio15,
|
||||
// pub gpio16: Gpio16,
|
||||
// pub gpio17: Gpio17,
|
||||
// pub gpio18: Gpio18,
|
||||
// //i2c here
|
||||
// pub gpio21: Gpio21,
|
||||
// pub gpio22: Gpio22,
|
||||
// pub gpio23: Gpio23,
|
||||
// pub gpio24: Gpio24,
|
||||
// pub gpio25: Gpio25,
|
||||
// pub gpio26: Gpio26,
|
||||
// pub gpio27: Gpio27,
|
||||
// pub gpio28: Gpio28,
|
||||
// pub gpio29: Gpio29,
|
||||
// pub gpio30: Gpio30,
|
||||
// pub pcnt0: PCNT0,
|
||||
// pub pcnt1: PCNT1,
|
||||
// pub adc1: ADC1,
|
||||
// pub can: CAN,
|
||||
}
|
||||
|
||||
impl PlantHal {
|
||||
fn create_i2c() -> Mutex<I2cDriver<'static>> {
|
||||
let peripherals = unsafe { Peripherals::new() };
|
||||
|
||||
let config = I2cConfig::new()
|
||||
.scl_enable_pullup(true)
|
||||
.sda_enable_pullup(true)
|
||||
.baudrate(100_u32.kHz().into())
|
||||
.timeout(APBTickType::from(Duration::from_millis(100)));
|
||||
|
||||
let i2c = peripherals.i2c0;
|
||||
let scl = peripherals.pins.gpio19.downgrade();
|
||||
let sda = peripherals.pins.gpio20.downgrade();
|
||||
|
||||
Mutex::new(I2cDriver::new(i2c, sda, scl, &config).unwrap())
|
||||
}
|
||||
// fn create_i2c() -> Mutex<CriticalSectionRawMutex, I2cDriver<'static>> {
|
||||
// let peripherals = unsafe { Peripherals::new() };
|
||||
//
|
||||
// let config = I2cConfig::new()
|
||||
// .scl_enable_pullup(true)
|
||||
// .sda_enable_pullup(true)
|
||||
// .baudrate(100_u32.kHz().into())
|
||||
// .timeout(APBTickType::from(Duration::from_millis(100)));
|
||||
//
|
||||
// let i2c = peripherals.i2c0;
|
||||
// let scl = peripherals.pins.gpio19.downgrade();
|
||||
// let sda = peripherals.pins.gpio20.downgrade();
|
||||
//
|
||||
// Mutex::new(I2cDriver::new(i2c, sda, scl, &config).unwrap())
|
||||
// }
|
||||
|
||||
pub fn create() -> Result<Mutex<CriticalSectionRawMutex, HAL<'static>>> {
|
||||
let peripherals = Peripherals::take()?;
|
||||
let sys_loop = EspSystemEventLoop::take()?;
|
||||
let nvs = EspDefaultNvsPartition::take()?;
|
||||
let wifi_driver = EspWifi::new(peripherals.modem, sys_loop, Some(nvs))?;
|
||||
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
|
||||
let peripherals = esp_hal::init(config);
|
||||
|
||||
let mut boot_button = PinDriver::input(peripherals.pins.gpio9.downgrade())?;
|
||||
boot_button.set_pull(Pull::Floating)?;
|
||||
esp_alloc::heap_allocator!(size: 64 * 1024);
|
||||
let timer0 = SystemTimer::new(peripherals.SYSTIMER);
|
||||
esp_hal_embassy::init(timer0.alarm0);
|
||||
|
||||
let free_pins = FreePeripherals {
|
||||
can: peripherals.can,
|
||||
adc1: peripherals.adc1,
|
||||
pcnt0: peripherals.pcnt0,
|
||||
pcnt1: peripherals.pcnt1,
|
||||
gpio0: peripherals.pins.gpio0,
|
||||
gpio1: peripherals.pins.gpio1,
|
||||
gpio2: peripherals.pins.gpio2,
|
||||
gpio3: peripherals.pins.gpio3,
|
||||
gpio4: peripherals.pins.gpio4,
|
||||
gpio5: peripherals.pins.gpio5,
|
||||
gpio6: peripherals.pins.gpio6,
|
||||
gpio7: peripherals.pins.gpio7,
|
||||
gpio8: peripherals.pins.gpio8,
|
||||
gpio10: peripherals.pins.gpio10,
|
||||
gpio11: peripherals.pins.gpio11,
|
||||
gpio12: peripherals.pins.gpio12,
|
||||
gpio13: peripherals.pins.gpio13,
|
||||
gpio14: peripherals.pins.gpio14,
|
||||
gpio15: peripherals.pins.gpio15,
|
||||
gpio16: peripherals.pins.gpio16,
|
||||
gpio17: peripherals.pins.gpio17,
|
||||
gpio18: peripherals.pins.gpio18,
|
||||
gpio21: peripherals.pins.gpio21,
|
||||
gpio22: peripherals.pins.gpio22,
|
||||
gpio23: peripherals.pins.gpio23,
|
||||
gpio24: peripherals.pins.gpio24,
|
||||
gpio25: peripherals.pins.gpio25,
|
||||
gpio26: peripherals.pins.gpio26,
|
||||
gpio27: peripherals.pins.gpio27,
|
||||
gpio28: peripherals.pins.gpio28,
|
||||
gpio29: peripherals.pins.gpio29,
|
||||
gpio30: peripherals.pins.gpio30,
|
||||
};
|
||||
|
||||
// let mut boot_button = PinDriver::input(peripherals.pins.gpio9.downgrade())?;
|
||||
// boot_button.set_pull(Pull::Floating)?;
|
||||
//
|
||||
// let free_pins = FreePeripherals {
|
||||
// can: peripherals.can,
|
||||
// adc1: peripherals.adc1,
|
||||
// pcnt0: peripherals.pcnt0,
|
||||
// pcnt1: peripherals.pcnt1,
|
||||
// gpio0: peripherals.pins.gpio0,
|
||||
// gpio1: peripherals.pins.gpio1,
|
||||
// gpio2: peripherals.pins.gpio2,
|
||||
// gpio3: peripherals.pins.gpio3,
|
||||
// gpio4: peripherals.pins.gpio4,
|
||||
// gpio5: peripherals.pins.gpio5,
|
||||
// gpio6: peripherals.pins.gpio6,
|
||||
// gpio7: peripherals.pins.gpio7,
|
||||
// gpio8: peripherals.pins.gpio8,
|
||||
// gpio10: peripherals.pins.gpio10,
|
||||
// gpio11: peripherals.pins.gpio11,
|
||||
// gpio12: peripherals.pins.gpio12,
|
||||
// gpio13: peripherals.pins.gpio13,
|
||||
// gpio14: peripherals.pins.gpio14,
|
||||
// gpio15: peripherals.pins.gpio15,
|
||||
// gpio16: peripherals.pins.gpio16,
|
||||
// gpio17: peripherals.pins.gpio17,
|
||||
// gpio18: peripherals.pins.gpio18,
|
||||
// gpio21: peripherals.pins.gpio21,
|
||||
// gpio22: peripherals.pins.gpio22,
|
||||
// gpio23: peripherals.pins.gpio23,
|
||||
// gpio24: peripherals.pins.gpio24,
|
||||
// gpio25: peripherals.pins.gpio25,
|
||||
// gpio26: peripherals.pins.gpio26,
|
||||
// gpio27: peripherals.pins.gpio27,
|
||||
// gpio28: peripherals.pins.gpio28,
|
||||
// gpio29: peripherals.pins.gpio29,
|
||||
// gpio30: peripherals.pins.gpio30,
|
||||
// };
|
||||
//
|
||||
let mut esp = Esp {
|
||||
mqtt_client: None,
|
||||
wifi_driver,
|
||||
boot_button,
|
||||
delay: Delay::new(1000),
|
||||
};
|
||||
mqtt_client: None,
|
||||
dummy: PhantomData::default()
|
||||
// wifi_driver,
|
||||
// boot_button
|
||||
};
|
||||
|
||||
//init,reset rtc memory depending on cause
|
||||
let mut init_rtc_store: bool = false;
|
||||
let mut to_config_mode: bool = false;
|
||||
let reasons = ResetReason::get();
|
||||
match reasons {
|
||||
ResetReason::Software => {}
|
||||
ResetReason::ExternalPin => {}
|
||||
ResetReason::Watchdog => {
|
||||
init_rtc_store = true;
|
||||
}
|
||||
ResetReason::Sdio => init_rtc_store = true,
|
||||
ResetReason::Panic => init_rtc_store = true,
|
||||
ResetReason::InterruptWatchdog => init_rtc_store = true,
|
||||
ResetReason::PowerOn => init_rtc_store = true,
|
||||
ResetReason::Unknown => init_rtc_store = true,
|
||||
ResetReason::Brownout => init_rtc_store = true,
|
||||
ResetReason::TaskWatchdog => init_rtc_store = true,
|
||||
ResetReason::DeepSleep => {}
|
||||
ResetReason::USBPeripheral => {
|
||||
init_rtc_store = true;
|
||||
to_config_mode = true;
|
||||
}
|
||||
ResetReason::JTAG => init_rtc_store = true,
|
||||
};
|
||||
let reasons = "";
|
||||
// let reasons = ResetReason::get();
|
||||
// match reasons {
|
||||
// ResetReason::Software => {}
|
||||
// ResetReason::ExternalPin => {}
|
||||
// ResetReason::Watchdog => {
|
||||
// init_rtc_store = true;
|
||||
// }
|
||||
// ResetReason::Sdio => init_rtc_store = true,
|
||||
// ResetReason::Panic => init_rtc_store = true,
|
||||
// ResetReason::InterruptWatchdog => init_rtc_store = true,
|
||||
// ResetReason::PowerOn => init_rtc_store = true,
|
||||
// ResetReason::Unknown => init_rtc_store = true,
|
||||
// ResetReason::Brownout => init_rtc_store = true,
|
||||
// ResetReason::TaskWatchdog => init_rtc_store = true,
|
||||
// ResetReason::DeepSleep => {}
|
||||
// ResetReason::USBPeripheral => {
|
||||
// init_rtc_store = true;
|
||||
// to_config_mode = true;
|
||||
// }
|
||||
// ResetReason::JTAG => init_rtc_store = true,
|
||||
// };
|
||||
log(
|
||||
LogMessage::ResetReason,
|
||||
init_rtc_store as u32,
|
||||
@@ -270,70 +256,76 @@ impl PlantHal {
|
||||
let config = esp.load_config();
|
||||
|
||||
log::info!("Init rtc driver");
|
||||
let mut rtc = Ds323x::new_ds3231(MutexDevice::new(&I2C_DRIVER));
|
||||
// let mut rtc = Ds323x::new_ds3231(MutexDevice::new(&I2C_DRIVER));
|
||||
//
|
||||
// log::info!("Init rtc eeprom driver");
|
||||
// let eeprom = {
|
||||
// Eeprom24x::new_24x32(
|
||||
// MutexDevice::new(&I2C_DRIVER),
|
||||
// SlaveAddr::Alternative(true, true, true),
|
||||
// )
|
||||
// };
|
||||
// let rtc_time = rtc.datetime();
|
||||
// match rtc_time {
|
||||
// OkStd(tt) => {
|
||||
// log::info!("Rtc Module reports time at UTC {}", tt);
|
||||
// }
|
||||
// Err(err) => {
|
||||
// log::info!("Rtc Module could not be read {:?}", err);
|
||||
// }
|
||||
// }
|
||||
|
||||
log::info!("Init rtc eeprom driver");
|
||||
let eeprom = {
|
||||
Eeprom24x::new_24x32(
|
||||
MutexDevice::new(&I2C_DRIVER),
|
||||
SlaveAddr::Alternative(true, true, true),
|
||||
)
|
||||
};
|
||||
let rtc_time = rtc.datetime();
|
||||
match rtc_time {
|
||||
OkStd(tt) => {
|
||||
log::info!("Rtc Module reports time at UTC {}", tt);
|
||||
}
|
||||
Err(err) => {
|
||||
log::info!("Rtc Module could not be read {:?}", err);
|
||||
}
|
||||
}
|
||||
|
||||
let storage = Storage::new(eeprom, Delay::new(1000));
|
||||
let rtc_module: Box<dyn RTCModuleInteraction + Send> =
|
||||
Box::new(DS3231Module { rtc, storage }) as Box<dyn RTCModuleInteraction + Send>;
|
||||
// let storage = Storage::new(eeprom, Delay::new(1000));
|
||||
//let rtc_module: Box<dyn RTCModuleInteraction + Send> =
|
||||
// Box::new(DS3231Module { rtc, storage }) as Box<dyn RTCModuleInteraction + Send>;
|
||||
|
||||
let hal = match config {
|
||||
Result::Ok(config) => {
|
||||
let battery_interaction: Box<dyn BatteryInteraction + Send> =
|
||||
match config.hardware.battery {
|
||||
BatteryBoardVersion::Disabled => Box::new(NoBatteryMonitor {}),
|
||||
BatteryBoardVersion::BQ34Z100G1 => {
|
||||
let mut battery_driver = Bq34z100g1Driver {
|
||||
i2c: MutexDevice::new(&I2C_DRIVER),
|
||||
delay: Delay::new(0),
|
||||
flash_block_data: [0; 32],
|
||||
};
|
||||
let status = print_battery_bq34z100(&mut battery_driver);
|
||||
match status {
|
||||
OkStd(_) => {}
|
||||
Err(err) => {
|
||||
log(
|
||||
LogMessage::BatteryCommunicationError,
|
||||
0u32,
|
||||
0,
|
||||
"",
|
||||
&format!("{err:?})"),
|
||||
);
|
||||
}
|
||||
}
|
||||
Box::new(BQ34Z100G1 { battery_driver })
|
||||
}
|
||||
// BatteryBoardVersion::BQ34Z100G1 => {
|
||||
// let mut battery_driver = Bq34z100g1Driver {
|
||||
// i2c: MutexDevice::new(&I2C_DRIVER),
|
||||
// delay: Delay::new(0),
|
||||
// flash_block_data: [0; 32],
|
||||
// };
|
||||
// let status = print_battery_bq34z100(&mut battery_driver);
|
||||
// match status {
|
||||
// Ok(_) => {}
|
||||
// Err(err) => {
|
||||
// log(
|
||||
// LogMessage::BatteryCommunicationError,
|
||||
// 0u32,
|
||||
// 0,
|
||||
// "",
|
||||
// &format!("{err:?})"),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// Box::new(BQ34Z100G1 { battery_driver })
|
||||
// }
|
||||
BatteryBoardVersion::WchI2cSlave => {
|
||||
// TODO use correct implementation once availible
|
||||
Box::new(NoBatteryMonitor {})
|
||||
}
|
||||
_ => {
|
||||
todo!()
|
||||
}
|
||||
};
|
||||
|
||||
let board_hal: Box<dyn BoardInteraction + Send> = match config.hardware.board {
|
||||
BoardVersion::INITIAL => {
|
||||
initial_hal::create_initial_board(free_pins, fs_mount_error, config, esp)?
|
||||
initial_hal::create_initial_board(fs_mount_error, config, esp)?
|
||||
}
|
||||
BoardVersion::V3 => {
|
||||
v3_hal::create_v3(free_pins, esp, config, battery_interaction, rtc_module)?
|
||||
}
|
||||
BoardVersion::V4 => {
|
||||
v4_hal::create_v4(free_pins, esp, config, battery_interaction, rtc_module)?
|
||||
// BoardVersion::V3 => {
|
||||
// v3_hal::create_v3(free_pins, esp, config, battery_interaction, rtc_module)?
|
||||
// }
|
||||
// BoardVersion::V4 => {
|
||||
// v4_hal::create_v4(free_pins, esp, config, battery_interaction, rtc_module)?
|
||||
// }
|
||||
_ => {
|
||||
todo!()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -349,7 +341,6 @@ impl PlantHal {
|
||||
);
|
||||
HAL {
|
||||
board_hal: initial_hal::create_initial_board(
|
||||
free_pins,
|
||||
fs_mount_error,
|
||||
PlantControllerConfig::default(),
|
||||
esp,
|
||||
|
||||
Reference in New Issue
Block a user