merge stuff
This commit is contained in:
@@ -138,10 +138,10 @@ pub(crate) fn create_v4(
|
||||
config: PlantControllerConfig,
|
||||
battery_monitor: Box<dyn BatteryInteraction + Send>,
|
||||
) -> anyhow::Result<Box<dyn BoardInteraction<'static> + Send + 'static>> {
|
||||
let mut awake = PinDriver::output(peripherals.gpio15.downgrade())?;
|
||||
let mut awake = PinDriver::output(peripherals.gpio21.downgrade())?;
|
||||
awake.set_high()?;
|
||||
|
||||
let mut general_fault = PinDriver::input_output(peripherals.gpio6.downgrade())?;
|
||||
let mut general_fault = PinDriver::input_output(peripherals.gpio23.downgrade())?;
|
||||
general_fault.set_pull(Pull::Floating)?;
|
||||
general_fault.set_low()?;
|
||||
|
||||
@@ -156,6 +156,12 @@ pub(crate) fn create_v4(
|
||||
)
|
||||
};
|
||||
|
||||
let mut extra1 = PinDriver::output(peripherals.gpio6.downgrade())?;
|
||||
extra1.set_high()?;
|
||||
|
||||
let mut extra2 = PinDriver::output(peripherals.gpio15.downgrade())?;
|
||||
extra1.set_high()?;
|
||||
|
||||
let mut one_wire_pin = PinDriver::input_output_od(peripherals.gpio18.downgrade())?;
|
||||
one_wire_pin.set_pull(Pull::Floating)?;
|
||||
|
||||
|
@@ -221,7 +221,7 @@ fn set_config(
|
||||
let config: PlantControllerConfig = serde_json::from_slice(&all)?;
|
||||
|
||||
let mut board = BOARD_ACCESS.lock().expect("board access");
|
||||
let _ = board.board_hal.set_config(config);
|
||||
board.board_hal.set_config(config)?;
|
||||
anyhow::Ok(Some("saved".to_owned()))
|
||||
}
|
||||
|
||||
@@ -341,6 +341,7 @@ fn ota(
|
||||
|
||||
let iter = (total_read / 1024) % 8;
|
||||
if iter != lastiter {
|
||||
board.board_hal.general_fault(iter%5==0);
|
||||
for i in 0..PLANT_COUNT {
|
||||
let _ = board.board_hal.fault(i, iter == i);
|
||||
}
|
||||
|
Reference in New Issue
Block a user