diff --git a/board/PlantCtrlESP32.kicad_sch b/board/PlantCtrlESP32.kicad_sch index ca9b105..9402bcb 100644 --- a/board/PlantCtrlESP32.kicad_sch +++ b/board/PlantCtrlESP32.kicad_sch @@ -4742,6 +4742,16 @@ ) (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" (exclude_from_sim no) (at 157.734 70.104 0) @@ -6151,7 +6161,7 @@ ) (global_label "WORKING" (shape input) - (at 224.79 72.39 0) + (at 224.79 87.63 0) (fields_autoplaced yes) (effects (font @@ -6161,7 +6171,7 @@ ) (uuid "0af53f6a-ea11-4d73-a8d1-f63ebcdc2e54") (property "Intersheetrefs" "${INTERSHEET_REFS}" - (at 235.6482 72.39 0) + (at 235.6482 87.63 0) (effects (font (size 1.27 1.27) @@ -6701,22 +6711,22 @@ ) (global_label "EXTRA_1" (shape input) - (at 224.79 92.71 0) + (at 184.15 82.55 180) (fields_autoplaced yes) (effects (font (size 1.27 1.27) ) - (justify left) + (justify right) ) (uuid "4635eda0-e395-42c7-9764-c7b7fc3019ec") (property "Intersheetrefs" "${INTERSHEET_REFS}" - (at 234.9828 92.71 0) + (at 173.9572 82.55 0) (effects (font (size 1.27 1.27) ) - (justify left) + (justify right) (hide yes) ) ) @@ -7075,22 +7085,22 @@ ) (global_label "WARN_LED" (shape input) - (at 184.15 82.55 180) + (at 224.79 92.71 0) (fields_autoplaced yes) (effects (font (size 1.27 1.27) ) - (justify right) + (justify left) ) (uuid "63850aa5-2eca-4827-9a2f-c5aed597072f") (property "Intersheetrefs" "${INTERSHEET_REFS}" - (at 172.2638 82.55 0) + (at 236.6762 92.71 0) (effects (font (size 1.27 1.27) ) - (justify right) + (justify left) (hide yes) ) ) @@ -7339,7 +7349,7 @@ ) (global_label "EXTRA_2" (shape input) - (at 224.79 87.63 0) + (at 224.79 72.39 0) (fields_autoplaced yes) (effects (font @@ -7349,7 +7359,7 @@ ) (uuid "79c7218b-c7f0-4a6c-8b1d-8ae92200b937") (property "Intersheetrefs" "${INTERSHEET_REFS}" - (at 234.9828 87.63 0) + (at 234.9828 72.39 0) (effects (font (size 1.27 1.27) diff --git a/rust/src/hal/v4_hal.rs b/rust/src/hal/v4_hal.rs index ddaae4a..c715871 100644 --- a/rust/src/hal/v4_hal.rs +++ b/rust/src/hal/v4_hal.rs @@ -138,10 +138,10 @@ pub(crate) fn create_v4( config: PlantControllerConfig, battery_monitor: Box, ) -> anyhow::Result + 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)?; diff --git a/rust/src/webserver/mod.rs b/rust/src/webserver/mod.rs index 93af359..1069a24 100644 --- a/rust/src/webserver/mod.rs +++ b/rust/src/webserver/mod.rs @@ -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); }