minimal startup running
This commit is contained in:
@@ -11,10 +11,12 @@ use crate::{
|
||||
use anyhow::{bail, Result};
|
||||
use async_trait::async_trait;
|
||||
use chrono::{DateTime, Utc};
|
||||
use esp_hal::gpio::{Level, Output, OutputConfig};
|
||||
use log::info;
|
||||
use measurements::{Current, Voltage};
|
||||
|
||||
pub struct Initial<'a> {
|
||||
//pub(crate) general_fault: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
|
||||
pub(crate) general_fault: Output<'a>,
|
||||
pub(crate) esp: Esp<'a>,
|
||||
pub(crate) config: PlantControllerConfig,
|
||||
pub(crate) battery: Box<dyn BatteryInteraction + Send>,
|
||||
@@ -47,21 +49,14 @@ impl RTCModuleInteraction for NoRTC {
|
||||
}
|
||||
|
||||
pub(crate) fn create_initial_board(
|
||||
//free_pins: FreePeripherals,
|
||||
_fs_mount_error: bool,
|
||||
free_pins: FreePeripherals<'static>,
|
||||
config: PlantControllerConfig,
|
||||
esp: Esp<'static>,
|
||||
) -> Result<Box<dyn BoardInteraction<'static> + Send>> {
|
||||
log::info!("Start initial");
|
||||
// let mut general_fault = PinDriver::input_output(free_pins.gpio6.downgrade())?;
|
||||
// general_fault.set_pull(Pull::Floating)?;
|
||||
// general_fault.set_low()?;
|
||||
//
|
||||
// if fs_mount_error {
|
||||
// general_fault.set_high()?
|
||||
// }
|
||||
let general_fault = Output::new(free_pins.gpio23, Level::Low, OutputConfig::default());
|
||||
let v = Initial {
|
||||
//general_fault,
|
||||
general_fault,
|
||||
config,
|
||||
esp,
|
||||
battery: Box::new(NoBatteryMonitor {}),
|
||||
@@ -122,8 +117,8 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
|
||||
bail!("Please configure board revision")
|
||||
}
|
||||
|
||||
async fn general_fault(&mut self, _enable: bool) {
|
||||
//let _ = self.general_fault.set_state(enable.into());
|
||||
async fn general_fault(&mut self, enable: bool) {
|
||||
self.general_fault.set_level(enable.into());
|
||||
}
|
||||
|
||||
async fn test(&mut self) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user