This commit is contained in:
2024-04-27 19:58:56 +02:00
parent 1fc04a58a0
commit bfb19321fd
4 changed files with 23 additions and 6 deletions

View File

@@ -69,12 +69,13 @@ strum = { version = "0.26.1", features = ["derive"] }
once_cell = "1.19.0"
measurements = "0.11.0"
bq34z100 = "0.2.1"
bitbang-hal = "0.3.2"
[patch.crates-io]
esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal.git" }
esp-idf-sys = { git = "https://github.com/empirephoenix/esp-idf-sys.git" }
# esp-idf-sys = { git = "https://github.com/esp-rs/esp-idf-sys.git" }
esp-idf-svc = { git = "https://github.com/esp-rs/esp-idf-svc.git" }
#esp-idf-sys = { git = "https://github.com/empirephoenix/esp-idf-sys.git" }
#esp-idf-sys = { git = "https://github.com/esp-rs/esp-idf-sys.git" }
#esp-idf-svc = { git = "https://github.com/esp-rs/esp-idf-svc.git" }
[build-dependencies]
embuild = "0.31.3"

View File

@@ -45,6 +45,8 @@ use esp_idf_svc::systime::EspSystemTime;
use esp_idf_sys::{esp, gpio_hold_dis, gpio_hold_en, vTaskDelay, EspError};
use one_wire_bus::OneWire;
use bitbang_hal;
use crate::config::{self, Config, WifiConfig};
use crate::STAY_ALIVE;
@@ -953,12 +955,13 @@ impl CreatePlantHal<'_> for PlantHal {
fn create() -> Result<Mutex<PlantCtrlBoard<'static>>> {
let peripherals = Peripherals::take()?;
let i2c = peripherals.i2c0;
let config = I2cConfig::new()
.scl_enable_pullup(false)
.sda_enable_pullup(false)
.baudrate(10_u32.kHz().into())
.timeout(Duration::from_millis(10).into);
.baudrate(1_u32.kHz().into())
.timeout(Duration::from_millis(10).into());
let scl = peripherals.pins.gpio19;
let sda = peripherals.pins.gpio20;