diff --git a/Cargo.toml b/Cargo.toml index a37f9520..619a7ac7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ license = "MIT" embedded-graphics = "0.8.0" embedded-hal = "1.0.0" embedded-hal-async = "1.0.0" -embedded-hal-bus = { version = "0.1.0", features = ["async"] } +embedded-hal-bus = { version = "0.2.0", features = ["async"] } embedded-nal-async = "0.7.0" embedded-io = "0.6" embedded-io-async = "0.6" @@ -21,7 +21,7 @@ embassy-net = { version = "0.4", features = [ "dns", "medium-ethernet", ] } -embassy-sync = { version = "0.5.0" } +embassy-sync = { version = "0.6.0" } embassy-executor = { version = "0.6" } heapless = "0.8" @@ -51,17 +51,17 @@ embassy-time = { version = "0.3.0" } embedded-hal-old = { package = "embedded-hal", version = "0.2.7" } -esp-hal = { version = "0.20.1" } -esp-hal-embassy = { version = "0.3.0" } -esp-backtrace = { version = "0.14.0", features = [ +esp-hal = { version = "0.21.0" } +esp-hal-embassy = { version = "0.4.0" } +esp-backtrace = { version = "0.14.2", features = [ "panic-handler", "exception-handler", ] } -esp-println = { version = "0.11.0", default-features = false, features = [ +esp-println = { version = "0.12.0", default-features = false, features = [ "critical-section", ] } -esp-alloc = "0.4.0" -esp-wifi = { version = "0.9.1", default-features = false, features = [ +esp-alloc = "0.5.0" +esp-wifi = { version = "0.10.1", default-features = false, features = [ "esp-alloc", "phy-enable-usb", "ps-max-modem", @@ -131,13 +131,13 @@ smoltcp = { workspace = true } crc = "3.0.1" enumset = "1.1.3" -[patch.crates-io] -esp-hal = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } -esp-hal-embassy = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } -esp-wifi = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } -esp-backtrace = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } -esp-println = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } -esp-alloc = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } +#[patch.crates-io] +#esp-hal = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } +#esp-hal-embassy = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } +#esp-wifi = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } +#esp-backtrace = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } +#esp-println = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } +#esp-alloc = { git = "https://github.com/bugadani/esp-hal.git", rev = "7ca1b4376fd48229c887018d7133ce317742ce4e" } [features] default = ["defmt"] diff --git a/src/board/hardware/v4.rs b/src/board/hardware/v4.rs index 3010c6b1..f5701809 100644 --- a/src/board/hardware/v4.rs +++ b/src/board/hardware/v4.rs @@ -12,7 +12,7 @@ use embedded_hal_bus::spi::ExclusiveDevice; use esp_hal::{ dma::*, gpio::{Input, Io, Level, Output}, - i2c::I2C, + i2c::I2c, interrupt::software::SoftwareInterruptControl, peripherals, rtc_cntl::Rtc, @@ -58,7 +58,7 @@ pub type PoweredEcgFrontend = pub type Display = DisplayType>; pub type BatteryFgI2cInstance = peripherals::I2C0; -pub type BatteryFgI2c = I2C<'static, BatteryFgI2cInstance, Async>; +pub type BatteryFgI2c = I2c<'static, BatteryFgI2cInstance, Async>; pub type BatteryFg = BatteryFgType; impl super::startup::StartupResources { diff --git a/src/board/hardware/v6c6.rs b/src/board/hardware/v6c6.rs index 271459f6..22f22d8d 100644 --- a/src/board/hardware/v6c6.rs +++ b/src/board/hardware/v6c6.rs @@ -13,7 +13,7 @@ use embedded_hal_bus::spi::ExclusiveDevice; use esp_hal::{ dma::*, gpio::{Input, Io, Level, Output, Pull}, - i2c::I2C, + i2c::I2c, interrupt::software::SoftwareInterruptControl, peripherals, prelude::*, @@ -57,7 +57,7 @@ pub type PoweredEcgFrontend = pub type Display = DisplayType>; pub type BatteryFgI2cInstance = peripherals::I2C0; -pub type BatteryFgI2c = I2C<'static, BatteryFgI2cInstance, Async>; +pub type BatteryFgI2c = I2c<'static, BatteryFgI2cInstance, Async>; pub type BatteryFg = BatteryFgType; impl super::startup::StartupResources { @@ -91,7 +91,8 @@ impl super::startup::StartupResources { ), Output::new(io.pins.gpio9, Level::High), Delay, - ), + ) + .unwrap(), io.pins.gpio4, io.pins.gpio15, io.pins.gpio23, diff --git a/src/board/hardware/v6s3.rs b/src/board/hardware/v6s3.rs index d69a6f5c..e97380c8 100644 --- a/src/board/hardware/v6s3.rs +++ b/src/board/hardware/v6s3.rs @@ -13,7 +13,7 @@ use embedded_hal_bus::spi::ExclusiveDevice; use esp_hal::{ dma::*, gpio::{Input, Io, Output}, - i2c::I2C, + i2c::I2c, interrupt::software::SoftwareInterruptControl, peripherals, rtc_cntl::Rtc, @@ -57,7 +57,7 @@ pub type PoweredEcgFrontend = pub type Display = DisplayType>; pub type BatteryFgI2cInstance = peripherals::I2C0; -pub type BatteryFgI2c = I2C<'static, BatteryFgI2cInstance, Async>; +pub type BatteryFgI2c = I2c<'static, BatteryFgI2cInstance, Async>; pub type BatteryFg = BatteryFgType; impl super::startup::StartupResources { diff --git a/src/board/startup.rs b/src/board/startup.rs index a1ec02e1..08545094 100644 --- a/src/board/startup.rs +++ b/src/board/startup.rs @@ -26,7 +26,7 @@ use esp_hal::{ use crate::board::{AdcDmaChannel, AdcSpiInstance}; #[cfg(feature = "battery_max17055")] -use esp_hal::i2c::I2C; +use esp_hal::i2c::I2c; #[cfg(feature = "battery_max17055")] use { crate::board::{BatteryAdcEnablePin, BatteryFg, BatteryFgI2cInstance}, @@ -115,7 +115,7 @@ impl StartupResources { Display::new( SPIInterface::new( - ExclusiveDevice::new(display_spi, DummyOutputPin, Delay), + ExclusiveDevice::new(display_spi, DummyOutputPin, Delay).unwrap(), Output::new(display_dc, Level::Low), ), Output::new(display_reset, Level::Low), @@ -147,6 +147,7 @@ impl StartupResources { Output::new(adc_cs, Level::High), Delay, ) + .unwrap() } #[inline(always)] @@ -203,7 +204,7 @@ impl StartupResources { Input::new(vbus_detect, Pull::None), Input::new(charger_status, Pull::Up), BatteryFg::new( - Max17055::new(I2C::new_async(i2c, sda, scl, 100u32.kHz()), design), + Max17055::new(I2c::new_async(i2c, sda, scl, 100u32.kHz()), design), fg_enable, ), )