Skip to content

Commit

Permalink
Merge pull request #158 from card-io-ecg/update
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
bugadani authored Jan 29, 2024
2 parents 66a2bc8 + 09ba446 commit 45cd345
Show file tree
Hide file tree
Showing 19 changed files with 76 additions and 107 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@
"flushregs",
"c"
]
},
{
"type": "probe-rs-debug",
"flashingConfig": {
"haltAfterReset": true
},
"request": "launch",
"name": "probe_rs Executable Test",
"chip": "esp32c6",
"coreConfigs": [
{
"programBinary": "${workspaceRoot}/target/riscv32imac-unknown-none-elf/debug/card_io_fw"
}
]
}
]
}
83 changes: 30 additions & 53 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,52 @@ license = "MIT"

[workspace.dependencies]
embedded-graphics = "0.8.0"
embedded-hal = "1.0.0-rc.1"
embedded-hal-async = "1.0.0-rc.1"
embedded-hal-bus = { version = "0.1.0-rc.1", features = ["async"] }
embedded-nal-async = "0.6.0"
embedded-hal = "1.0.0"
embedded-hal-async = "1.0.0"
embedded-hal-bus = { version = "0.1.0", features = ["async"] }
embedded-nal-async = "0.7.0"
embedded-io = "0.6"
embedded-io-async = "0.6"
embedded-menu = "0.5.2"
embedded-svc = { version = "0.26", default-features = false }
embassy-net = { version = "0.2.1", features = [
"nightly",
embedded-svc = { version = "0.27", default-features = false }
embassy-net = { version = "0.4", features = [
"tcp",
"dhcpv4",
"dns",
"medium-ethernet",
] }
embassy-sync = { version = "0.4.0" }
embassy-executor = { version = "0.3.2", features = [
"nightly",
] }
embassy-sync = { version = "0.5.0" }
embassy-executor = { version = "0.5" }

heapless = "0.7"
heapless = "0.8"
log = { version = "0.4.18", default-features = false, features = [
"max_level_info",
"release_max_level_info",
] }
logger = { path = "logger" }
signal-processing = { path = "signal-processing" }
norfs = { git = "https://github.com/card-io-ecg/norfs.git", rev = "01c1905" }
norfs-driver = { git = "https://github.com/card-io-ecg/norfs.git", rev = "01c1905" }
norfs-esp32s3 = { git = "https://github.com/card-io-ecg/norfs.git", rev = "01c1905" }
norfs-esp32c6 = { git = "https://github.com/card-io-ecg/norfs.git", rev = "01c1905" }
norfs = { git = "https://github.com/card-io-ecg/norfs.git", rev = "19e14b5" }
norfs-driver = { git = "https://github.com/card-io-ecg/norfs.git", rev = "19e14b5" }
norfs-esp32s3 = { git = "https://github.com/card-io-ecg/norfs.git", rev = "19e14b5" }
norfs-esp32c6 = { git = "https://github.com/card-io-ecg/norfs.git", rev = "19e14b5" }
object-chain = "0.1.3"
bad-server = { path = "bad-server" }
defmt = { version = "=0.3.5" }
ufmt = "0.2.0"

smoltcp = { version = "0.10.0", default-features = false, features = [
smoltcp = { version = "0.11.0", default-features = false, features = [
"dns-max-server-count-2",
] }

[dependencies]
embassy-futures = { version = "0.1.0" }
embassy-executor = { workspace = true }
embassy-time = { version = "0.1.5", features = ["nightly", "unstable-traits"] }
embassy-executor = { workspace = true, features = ["nightly"] }
embassy-time = { version = "0.3.0" }

embedded-hal-old = { package = "embedded-hal", version = "0.2.7" }

# esp32s2-hal = { version = "0.10.0", optional = true, features = ["rt", "async", "embassy", "embassy-time-systick", "eh1"] }
esp32s3-hal = { version = "0.13.0", optional = true, features = [
esp32s3-hal = { version = "0.15.0", optional = true, features = [
"rt",
"async",
"embassy",
Expand All @@ -65,26 +62,25 @@ esp32s3-hal = { version = "0.13.0", optional = true, features = [
"embassy-time-systick",
"eh1",
] }
esp32c6-hal = { version = "0.6.0", optional = true, default-features = false, features = [
esp32c6-hal = { version = "0.8.0", optional = true, default-features = false, features = [
"rt",
"vectored",
"zero-rtc-bss",
"embassy-generic-queue-8",
"async",
"embassy",
"embassy-executor-thread",
"embassy-executor-interrupt",
"eh1",
] }
esp-backtrace = { version = "0.9.0", features = [
esp-backtrace = { version = "0.10.0", features = [
"panic-handler",
"exception-handler",
] }
esp-println = { version = "0.7.0", default-features = false, features = [
esp-println = { version = "0.8.0", default-features = false, features = [
"critical-section",
] }
esp-alloc = "0.3.0"
esp-wifi = { version = "0.1.1", default-features = false, features = [
esp-wifi = { version = "0.3.0", default-features = false, features = [
"phy-enable-usb",
"ps-max-modem",
"wifi",
Expand All @@ -96,12 +92,10 @@ esp-wifi = { version = "0.1.1", default-features = false, features = [
"dhcpv4"
] }

display-interface = { git = "https://github.com/therealprof/display-interface.git" }
display-interface-spi = { git = "https://github.com/therealprof/display-interface.git" }
display-interface = "0.5"
display-interface-spi = "0.5"
ssd1306 = { git = "https://github.com/bugadani/ssd1306.git", branch = "ehal1", features = [
"async",
"graphics",
"nightly",
] }

atomic_enum = "0.2.0"
Expand All @@ -121,10 +115,10 @@ signal-processing = { workspace = true, features = ["alloc"] }
replace_with = { version = "0.1", default-features = false, features = [
"nightly",
] }
static_cell = { version = "=1.2.0", features = ["nightly"] }
static_cell = { version = "2.0.0", features = ["nightly"] }
bad-server = { path = "bad-server", features = ["embassy"] }
embedded-tls = { version = "0.16.2", default-features = false, features = ["async"] }
reqwless = "0.9.0"
embedded-tls = { version = "0.17.0", default-features = false }
reqwless = "0.11.0"

embedded-graphics.workspace = true
embedded-hal.workspace = true
Expand Down Expand Up @@ -158,23 +152,6 @@ smoltcp = { workspace = true }
crc = "3.0.1"
enumset = "1.1.3"

[patch.crates-io]
esp32s3-hal = { git = "https://github.com/bugadani/esp-hal.git", branch = "c6sleep" }
esp32c6-hal = { git = "https://github.com/bugadani/esp-hal.git", branch = "c6sleep" }
esp-println = { git = "https://github.com/esp-rs/esp-println.git" }
esp-wifi = { git = "https://github.com/esp-rs/esp-wifi.git", rev = "d46dfc4" }
# esp-backtrace = { path = "../../esp-backtrace" }
# embedded-text = { git = "https://github.com/embedded-graphics/embedded-text.git" }
# esp32-hal = { path = "../../esp-hal/esp32-hal" }
# esp32s2-hal = { path = "../../esp-hal/esp32s2-hal" }
# esp32s3-hal = { path = "../../esp-hal/esp32s3-hal" }
# esp32c2-hal = { path = "../../esp-hal/esp32c2-hal" }
# esp32c3-hal = { path = "../../esp-hal/esp32c3-hal" }
# esp32c6-hal = { path = "../../esp-hal/esp32c6-hal" }
# esp-hal-common = { path = "../../esp-hal/esp-hal-common" }
# esp-hal-procmacros = { path = "../../esp-hal/esp-hal-procmacros" }
# esp-wifi = { path = "../esp-wifi/esp-wifi" }

[features]
default = ["defmt"]

Expand All @@ -194,16 +171,17 @@ esp32s3 = [
"dep:norfs-esp32s3",
"esp-backtrace/esp32s3",
"esp-println/esp32s3",
"jtag_serial",
"jtag-serial",
"esp-wifi/esp32s3",
]
esp32c6 = [
"dep:esp32c6-hal",
"esp32c6-hal/embassy-time-timg0",
"embassy-time/generic-queue-8",
"dep:norfs-esp32c6",
"esp-backtrace/esp32c6",
"esp-println/esp32c6",
"jtag_serial",
"jtag-serial",
"esp-wifi/esp32c6",
]

Expand All @@ -212,8 +190,7 @@ downsampler-light = [] # uses IIR-based filtering and less memory

# Print options
uart = ["esp-backtrace/print-uart", "esp-println/uart"]
jtag_serial = ["esp-backtrace/print-jtag-serial", "esp-println/jtag_serial"]
rtt = ["esp-backtrace/print-rtt", "esp-println/rtt"]
jtag-serial = ["esp-backtrace/print-jtag-serial", "esp-println/jtag-serial"]

log = [
"dep:log",
Expand Down
12 changes: 6 additions & 6 deletions ads129x/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ where
self.spi
.transaction(&mut [
Operation::Write(command),
Operation::DelayUs(WAIT_TIME_AFTER_TRANSFER),
Operation::DelayNs(WAIT_TIME_AFTER_TRANSFER),
])
.map_err(Error::Transfer)
} else {
self.spi
.transaction(&mut [
Operation::Write(command),
Operation::TransferInPlace(payload),
Operation::DelayUs(WAIT_TIME_AFTER_TRANSFER),
Operation::DelayNs(WAIT_TIME_AFTER_TRANSFER),
])
.map_err(Error::Transfer)
}
Expand All @@ -282,7 +282,7 @@ where
config.apply(self)
}

pub fn reset<RESET>(&self, reset: &mut RESET, delay: &mut impl embedded_hal::delay::DelayUs)
pub fn reset<RESET>(&self, reset: &mut RESET, delay: &mut impl embedded_hal::delay::DelayNs)
where
RESET: OutputPin,
{
Expand Down Expand Up @@ -357,7 +357,7 @@ where
self.spi
.transaction(&mut [
Operation::Write(command),
Operation::DelayUs(WAIT_TIME_AFTER_TRANSFER),
Operation::DelayNs(WAIT_TIME_AFTER_TRANSFER),
])
.await
.map_err(Error::Transfer)
Expand All @@ -366,7 +366,7 @@ where
.transaction(&mut [
Operation::Write(command),
Operation::TransferInPlace(payload),
Operation::DelayUs(WAIT_TIME_AFTER_TRANSFER),
Operation::DelayNs(WAIT_TIME_AFTER_TRANSFER),
])
.await
.map_err(Error::Transfer)
Expand Down Expand Up @@ -398,7 +398,7 @@ where
pub async fn reset_async<RESET>(
&mut self,
reset: &mut RESET,
delay: &mut impl embedded_hal_async::delay::DelayUs,
delay: &mut impl embedded_hal_async::delay::DelayNs,
) -> Result<(), Error<SPI::Error>>
where
RESET: OutputPin,
Expand Down
2 changes: 1 addition & 1 deletion bad-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmt = { workspace = true, optional = true }
embassy-net = { workspace = true, optional = true }
embedded-io-async = { workspace = true }
embedded-svc = { workspace = true }
heapless = { workspace = true, features = ["ufmt-impl"] }
heapless = { workspace = true, features = ["ufmt"] }
httparse = { version = "1.8", default-features = false }
logger = { workspace = true }
log = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ embedded-menu = { workspace = true }
norfs = { workspace = true }
embedded-io = { workspace = true }
embedded-io-async = { workspace = true }
heapless = { workspace = true, features = ["ufmt-impl"] }
heapless = { workspace = true, features = ["ufmt"] }
embedded-text = "0.6.6"
embedded-layout = "0.4.1"
tinybmp = "0.5"
Expand Down
10 changes: 5 additions & 5 deletions max17055/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern crate logger;
use byte_slice_cast::AsMutByteSlice;
use device_descriptor::{ReadOnlyRegister, ReaderProxy, Register};
use embedded_hal::i2c::I2c;
use embedded_hal_async::{delay::DelayUs as AsyncDelayUs, i2c::I2c as AsyncI2c};
use embedded_hal_async::{delay::DelayNs as AsyncDelayNs, i2c::I2c as AsyncI2c};
use register_access::{AsyncRegisterAccess, RegisterAccess};

use crate::descriptors::*;
Expand Down Expand Up @@ -299,7 +299,7 @@ where
async fn write_and_verify_register_async<R>(
&mut self,
reg: R,
delay: &mut impl AsyncDelayUs,
delay: &mut impl AsyncDelayNs,
) -> Result<(), Error<I2C::Error>>
where
R: Register<RegisterWidth = u16>,
Expand All @@ -317,7 +317,7 @@ where

async fn poll_async<R: ReadOnlyRegister<RegisterWidth = u16>>(
&mut self,
delay: &mut impl AsyncDelayUs,
delay: &mut impl AsyncDelayNs,
predicate: impl Fn(&R) -> bool,
) -> Result<(), Error<I2C::Error>> {
loop {
Expand All @@ -336,7 +336,7 @@ where
/// procedure from the datasheet.
pub async fn load_initial_config_async(
&mut self,
delay: &mut impl AsyncDelayUs,
delay: &mut impl AsyncDelayNs,
) -> Result<(), Error<I2C::Error>> {
trace!("Loading initial configuration");

Expand Down Expand Up @@ -546,7 +546,7 @@ where
pub async fn restore_learned_params(
&mut self,
params: &LearnedParams,
delay: &mut impl AsyncDelayUs,
delay: &mut impl AsyncDelayNs,
) -> Result<(), Error<I2C::Error>> {
self.write_and_verify_register_async(RComp0::from_bits(params.rcomp0), delay)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion src/board/config/current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Default for Config {
display_brightness: DisplayBrightness::Normal,
known_networks: heapless::Vec::new(),
filter_strength: FilterStrength::Weak,
backend_url: heapless::String::from(DEFAULT_BACKEND_URL),
backend_url: heapless::String::try_from(DEFAULT_BACKEND_URL).unwrap(),
measurement_action: MeasurementAction::Auto,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/board/config/v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl From<super::v2::Config> for Config {
display_brightness: value.display_brightness,
known_networks: value.known_networks,
filter_strength: FilterStrength::Weak,
backend_url: heapless::String::from(DEFAULT_BACKEND_URL),
backend_url: heapless::String::try_from(DEFAULT_BACKEND_URL).unwrap(),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/board/drivers/battery_monitor/battery_fg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use embassy_time::{Delay, Duration, Ticker};
use embedded_hal::digital::OutputPin;
use embedded_hal_async::{delay::DelayUs, i2c::I2c};
use embedded_hal_async::{delay::DelayNs, i2c::I2c};
use max17055::Max17055;

#[cfg(all(feature = "esp32s3", not(feature = "hw_v6")))]
Expand Down Expand Up @@ -28,7 +28,7 @@ where
Self { fg, enable }
}

pub async fn enable<D: DelayUs>(&mut self, delay: &mut D) -> Result<(), ()> {
pub async fn enable<D: DelayNs>(&mut self, delay: &mut D) -> Result<(), ()> {
self.enable.set_high().map_err(|_| ())?;
delay.delay_ms(10).await;
self.fg
Expand Down
Loading

0 comments on commit 45cd345

Please sign in to comment.