Skip to content

Commit

Permalink
Update to new esp-hal release
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 10, 2024
1 parent ed31194 commit 08369ef
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions src/board/hardware/v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -58,7 +58,7 @@ pub type PoweredEcgFrontend =
pub type Display = DisplayType<Output<'static>>;

pub type BatteryFgI2cInstance = peripherals::I2C0;
pub type BatteryFgI2c = I2C<'static, BatteryFgI2cInstance, Async>;
pub type BatteryFgI2c = I2c<'static, BatteryFgI2cInstance, Async>;
pub type BatteryFg = BatteryFgType<BatteryFgI2c, BatteryAdcEnablePin>;

impl super::startup::StartupResources {
Expand Down
7 changes: 4 additions & 3 deletions src/board/hardware/v6c6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*,
Expand Down Expand Up @@ -57,7 +57,7 @@ pub type PoweredEcgFrontend =
pub type Display = DisplayType<Output<'static>>;

pub type BatteryFgI2cInstance = peripherals::I2C0;
pub type BatteryFgI2c = I2C<'static, BatteryFgI2cInstance, Async>;
pub type BatteryFgI2c = I2c<'static, BatteryFgI2cInstance, Async>;
pub type BatteryFg = BatteryFgType<BatteryFgI2c, BatteryAdcEnablePin>;

impl super::startup::StartupResources {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/board/hardware/v6s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -57,7 +57,7 @@ pub type PoweredEcgFrontend =
pub type Display = DisplayType<Output<'static>>;

pub type BatteryFgI2cInstance = peripherals::I2C0;
pub type BatteryFgI2c = I2C<'static, BatteryFgI2cInstance, Async>;
pub type BatteryFgI2c = I2c<'static, BatteryFgI2cInstance, Async>;
pub type BatteryFg = BatteryFgType<BatteryFgI2c, BatteryAdcEnablePin>;

impl super::startup::StartupResources {
Expand Down
7 changes: 4 additions & 3 deletions src/board/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -147,6 +147,7 @@ impl StartupResources {
Output::new(adc_cs, Level::High),
Delay,
)
.unwrap()
}

#[inline(always)]
Expand Down Expand Up @@ -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,
),
)
Expand Down

0 comments on commit 08369ef

Please sign in to comment.