merge stuff

This commit is contained in:
Empire Phoenix 2025-06-23 22:21:03 +02:00
parent 736925f7de
commit 450197c7cd
3 changed files with 32 additions and 15 deletions

View File

@ -4742,6 +4742,16 @@
) )
(uuid f1cb09e6-74b4-43c4-8247-c9f441069dc5) (uuid f1cb09e6-74b4-43c4-8247-c9f441069dc5)
) )
(text "GPIO21 pulses high during flashing!\nGPIO19 is used for communication during flashing"
(exclude_from_sim no)
(at 202.692 102.362 0)
(effects
(font
(size 1.27 1.27)
)
)
(uuid "2195adc7-ab0b-4ee3-aa2e-b2786571de43")
)
(text "To Allow Wakeup via interrupt" (text "To Allow Wakeup via interrupt"
(exclude_from_sim no) (exclude_from_sim no)
(at 157.734 70.104 0) (at 157.734 70.104 0)
@ -6151,7 +6161,7 @@
) )
(global_label "WORKING" (global_label "WORKING"
(shape input) (shape input)
(at 224.79 72.39 0) (at 224.79 87.63 0)
(fields_autoplaced yes) (fields_autoplaced yes)
(effects (effects
(font (font
@ -6161,7 +6171,7 @@
) )
(uuid "0af53f6a-ea11-4d73-a8d1-f63ebcdc2e54") (uuid "0af53f6a-ea11-4d73-a8d1-f63ebcdc2e54")
(property "Intersheetrefs" "${INTERSHEET_REFS}" (property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 235.6482 72.39 0) (at 235.6482 87.63 0)
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)
@ -6701,22 +6711,22 @@
) )
(global_label "EXTRA_1" (global_label "EXTRA_1"
(shape input) (shape input)
(at 224.79 92.71 0) (at 184.15 82.55 180)
(fields_autoplaced yes) (fields_autoplaced yes)
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)
) )
(justify left) (justify right)
) )
(uuid "4635eda0-e395-42c7-9764-c7b7fc3019ec") (uuid "4635eda0-e395-42c7-9764-c7b7fc3019ec")
(property "Intersheetrefs" "${INTERSHEET_REFS}" (property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 234.9828 92.71 0) (at 173.9572 82.55 0)
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)
) )
(justify left) (justify right)
(hide yes) (hide yes)
) )
) )
@ -7075,22 +7085,22 @@
) )
(global_label "WARN_LED" (global_label "WARN_LED"
(shape input) (shape input)
(at 184.15 82.55 180) (at 224.79 92.71 0)
(fields_autoplaced yes) (fields_autoplaced yes)
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)
) )
(justify right) (justify left)
) )
(uuid "63850aa5-2eca-4827-9a2f-c5aed597072f") (uuid "63850aa5-2eca-4827-9a2f-c5aed597072f")
(property "Intersheetrefs" "${INTERSHEET_REFS}" (property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 172.2638 82.55 0) (at 236.6762 92.71 0)
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)
) )
(justify right) (justify left)
(hide yes) (hide yes)
) )
) )
@ -7339,7 +7349,7 @@
) )
(global_label "EXTRA_2" (global_label "EXTRA_2"
(shape input) (shape input)
(at 224.79 87.63 0) (at 224.79 72.39 0)
(fields_autoplaced yes) (fields_autoplaced yes)
(effects (effects
(font (font
@ -7349,7 +7359,7 @@
) )
(uuid "79c7218b-c7f0-4a6c-8b1d-8ae92200b937") (uuid "79c7218b-c7f0-4a6c-8b1d-8ae92200b937")
(property "Intersheetrefs" "${INTERSHEET_REFS}" (property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 234.9828 87.63 0) (at 234.9828 72.39 0)
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)

View File

@ -138,10 +138,10 @@ pub(crate) fn create_v4(
config: PlantControllerConfig, config: PlantControllerConfig,
battery_monitor: Box<dyn BatteryInteraction + Send>, battery_monitor: Box<dyn BatteryInteraction + Send>,
) -> anyhow::Result<Box<dyn BoardInteraction<'static> + Send + 'static>> { ) -> 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()?; 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_pull(Pull::Floating)?;
general_fault.set_low()?; 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())?; let mut one_wire_pin = PinDriver::input_output_od(peripherals.gpio18.downgrade())?;
one_wire_pin.set_pull(Pull::Floating)?; one_wire_pin.set_pull(Pull::Floating)?;

View File

@ -221,7 +221,7 @@ fn set_config(
let config: PlantControllerConfig = serde_json::from_slice(&all)?; let config: PlantControllerConfig = serde_json::from_slice(&all)?;
let mut board = BOARD_ACCESS.lock().expect("board access"); 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())) anyhow::Ok(Some("saved".to_owned()))
} }
@ -341,6 +341,7 @@ fn ota(
let iter = (total_read / 1024) % 8; let iter = (total_read / 1024) % 8;
if iter != lastiter { if iter != lastiter {
board.board_hal.general_fault(iter%5==0);
for i in 0..PLANT_COUNT { for i in 0..PLANT_COUNT {
let _ = board.board_hal.fault(i, iter == i); let _ = board.board_hal.fault(i, iter == i);
} }