Compare commits

..

No commits in common. "fe4b57808d1f9310ec6812b1c48360b3574c56e6" and "d2fb6b8411bfeeefe168677c3c90b923689cc9f6" have entirely different histories.

6 changed files with 1893 additions and 3076 deletions

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@
39,
40
],
"visible_layers": "ffc7075_ffffffff",
"visible_layers": "ffc7055_ffffffff",
"zone_display_mode": 1
},
"git": {

View File

@ -98,7 +98,6 @@
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"holes_co_located": "warning",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
@ -1070,7 +1069,6 @@
},
"schematic": {
"annotate_start_num": 0,
"bom_export_filename": "",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -204,7 +204,6 @@ pub struct PlantCtrlBoard<'a> {
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
>,
shift_register_enable_invert: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Output>,
tank_channel: AdcChannelDriver<'a, Gpio5, AdcDriver<'a, esp_idf_hal::adc::ADC1>>,
solar_is_day: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
boot_button: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
@ -404,7 +403,7 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
self.signal_counter.counter_pause()?;
self.signal_counter.counter_clear()?;
//Disable all
self.shift_register.decompose()[MS_4]
self.shift_register.decompose()[SENSOR_ON]
.set_high()
.unwrap();
@ -436,11 +435,8 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
self.sensor_multiplexer(sensor_channel)?;
self.shift_register.decompose()[MS_4]
.set_low()
.unwrap();
self.shift_register.decompose()[SENSOR_ON]
.set_high()
.set_low()
.unwrap();
let delay = Delay::new_default();
@ -452,11 +448,8 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
self.signal_counter.counter_resume()?;
delay.delay_ms(measurement);
self.signal_counter.counter_pause()?;
self.shift_register.decompose()[MS_4]
.set_high()
.unwrap();
self.shift_register.decompose()[SENSOR_ON]
.set_low()
.set_high()
.unwrap();
let unscaled = self.signal_counter.get_counter_value()? as i32;
let hz = (unscaled as f32 * factor) as i32;
@ -1115,15 +1108,8 @@ impl CreatePlantHal<'_> for PlantHal {
one_wire_pin.set_pull(Pull::Floating).unwrap();
//disable all
let ms1 = &mut shift_register.decompose()[MS_1];
ms1.set_low()?;
let ms2 = &mut shift_register.decompose()[MS_2];
ms2.set_low()?;
let ms3 = &mut shift_register.decompose()[MS_3];
ms3.set_low()?;
let ms4 = &mut shift_register.decompose()[MS_4];
ms4.set_low()?;
ms4.set_high()?;
//init,reset rtc memory depending on cause
let reasons = ResetReason::get();
@ -1236,7 +1222,6 @@ impl CreatePlantHal<'_> for PlantHal {
let mut general_fault = PinDriver::input_output(peripherals.pins.gpio6.downgrade())?;
general_fault.set_pull(Pull::Floating)?;
general_fault.set_low()?;
let one_wire_bus = OneWire::new(one_wire_pin)
.map_err(|err| -> anyhow::Error { anyhow!("Missing attribute: {:?}", err) })?;
@ -1248,13 +1233,8 @@ impl CreatePlantHal<'_> for PlantHal {
} else {
println!("Managed to comunnicate with battery");
}
let mut shift_register_enable_invert = PinDriver::output(peripherals.pins.gpio21.downgrade())?;
shift_register_enable_invert.set_low().unwrap();
let rv = Mutex::new(PlantCtrlBoard {
shift_register,
shift_register_enable_invert,
tank_channel,
solar_is_day,
boot_button,