Skip to content

Commit

Permalink
Update dependencies (#21)
Browse files Browse the repository at this point in the history
* Update dependencies

* Use nightly in CI
  • Loading branch information
bjoernQ authored Nov 8, 2023
1 parent ea41ee7 commit fcc50ea
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 489 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf
toolchain: nightly-2023-03-09
toolchain: nightly
components: rust-src,rustfmt
- uses: esp-rs/[email protected]
with:
Expand Down
120 changes: 97 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,124 @@ lto = false
opt-level = 3

[dependencies]
esp32-hal = { version = "0.15.0", optional = true }
esp32c3-hal = { version = "0.12.0", optional = true }
esp32s2-hal = { version = "0.12.0", optional = true }
esp32s3-hal = { version = "0.12.0", optional = true }
esp-backtrace = { version = "0.6.0", features = ["panic-handler", "print-uart", "exception-handler"] }
esp-println = { version = "0.4.0", features = ["log"] }
esp32-hal = { version = "0.16.0", optional = true }
esp32c3-hal = { version = "0.13.0", optional = true }
esp32s2-hal = { version = "0.13.0", optional = true }
esp32s3-hal = { version = "0.13.0", optional = true }
esp-backtrace = { version = "0.9.0", features = [
"panic-handler",
"print-uart",
"exception-handler",
] }
esp-println = { version = "0.7.0", features = ["log"] }

embassy-time = { version = "0.1.0", features = ["nightly"], optional = true }
embassy-executor = { version = "0.2.0", package = "embassy-executor", features = ["nightly", "executor-thread", "integrated-timers"], optional = true }
embassy-net = { version = "0.1.0", features = ["nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"], optional = true }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-executor = { version = "0.3.0", package = "embassy-executor", features = [
"nightly",
"executor-thread",
"integrated-timers",
], optional = true }
embassy-net = { version = "0.2.1", features = [
"nightly",
"tcp",
"udp",
"dhcpv4",
"medium-ethernet",
], optional = true }

esp-wifi = { git = "https://github.com/esp-rs/esp-wifi.git", features = ["big-heap", "phy-enable-usb", "embedded-svc", "wifi"], rev = "fbb8417fc450ec0701067b36629770c11338231c" }
smoltcp = { version = "0.10.0", default-features=false, features = ["proto-igmp", "proto-ipv4", "socket-tcp", "socket-icmp", "socket-udp", "medium-ethernet", "proto-dhcpv4", "socket-raw", "socket-dhcpv4"] }
embedded-svc = { version = "0.25.0", default-features = false}
esp-wifi = { git = "https://github.com/esp-rs/esp-wifi.git", features = [
"big-heap",
"phy-enable-usb",
"embedded-svc",
"wifi",
], rev = "516608916e71671e99c234511df93801fde2d3a3" }
smoltcp = { version = "0.10.0", default-features = false, features = [
"proto-igmp",
"proto-ipv4",
"socket-tcp",
"socket-icmp",
"socket-udp",
"medium-ethernet",
"proto-dhcpv4",
"socket-raw",
"socket-dhcpv4",
] }
embedded-svc = { version = "0.26.2", default-features = false }
log = "0.4.16"
embedded-hal = "0.2"
embedded-io = "0.4.0"
embedded-io = "0.6.1"
embedded-io-async = { version = "0.6.0", optional = true }
heapless = "0.7.16"
critical-section = "1.0.1"
static_cell = { version = "=1.2", features = ["nightly"] }

esp-mbedtls = { path = "./esp-mbedtls" }

[target.xtensa-esp32s3-none-elf.dependencies]

[[example]]
name = "async_client"
name = "async_client"
required-features = ["async"]

[[example]]
name = "async_client_mTLS"
name = "async_client_mTLS"
required-features = ["async"]

[[example]]
name = "async_server"
name = "async_server"
required-features = ["async"]

[[example]]
name = "async_server_mTLS"
name = "async_server_mTLS"
required-features = ["async"]

[features]
esp32 = ["esp32-hal/embassy-time-timg0", "esp-backtrace/esp32", "esp-println/esp32", "embassy-executor?/arch-xtensa", "esp-wifi/esp32", "esp-mbedtls/esp32"]
esp32c3 = ["esp32c3-hal/embassy-time-timg0", "esp-backtrace/esp32c3", "esp-println/esp32c3", "embassy-executor?/arch-riscv32", "esp-wifi/esp32c3", "esp-mbedtls/esp32c3"]
esp32s2 = ["esp32s2-hal/embassy-time-timg0", "esp-backtrace/esp32s2", "esp-println/esp32s2", "embassy-executor?/arch-xtensa", "esp-wifi/esp32s2", "esp-mbedtls/esp32s2"]
esp32s3 = ["esp32s3-hal/embassy-time-timg0", "esp-backtrace/esp32s3", "esp-println/esp32s3", "embassy-executor?/arch-xtensa", "esp-wifi/esp32s3", "esp-mbedtls/esp32s3"]
async = ["esp-wifi/async", "esp-wifi/embassy-net", "embassy-executor", "embassy-net", "embassy-time", "embedded-io/async", "esp-mbedtls/async"]

esp32 = [
"esp32-hal/embassy-time-timg0",
"esp-backtrace/esp32",
"esp-println/esp32",
"esp-wifi/esp32",
"esp-mbedtls/esp32",
]
esp32c3 = [
"esp32c3-hal/embassy-time-timg0",
"esp-backtrace/esp32c3",
"esp-println/esp32c3",
"embassy-executor?/arch-riscv32",
"esp-wifi/esp32c3",
"esp-mbedtls/esp32c3",
]
esp32s2 = [
"esp32s2-hal/embassy-time-timg0",
"esp-backtrace/esp32s2",
"esp-println/esp32s2",
"esp-wifi/esp32s2",
"esp-mbedtls/esp32s2",
]
esp32s3 = [
"esp32s3-hal/embassy-time-timg0",
"esp-backtrace/esp32s3",
"esp-println/esp32s3",
"esp-wifi/esp32s3",
"esp-mbedtls/esp32s3",
]
async = [
"esp-wifi/async",
"esp-wifi/embassy-net",
"embassy-executor",
"embassy-net",
"embassy-time",
"dep:embedded-io-async",
"esp-mbedtls/async",
"esp32c3-hal?/embassy",
"esp32-hal?/embassy",
"esp32s2-hal?/embassy",
"esp32s3-hal?/embassy",
"esp32c3-hal?/async",
"esp32-hal?/async",
"esp32s2-hal?/async",
"esp32s3-hal?/async",
"esp32-hal?/embassy-executor-thread",
"esp32s2-hal?/embassy-executor-thread",
"esp32s3-hal?/embassy-executor-thread",
]
13 changes: 7 additions & 6 deletions esp-mbedtls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ edition = "2021"
[dependencies]
esp-mbedtls-sys = { path = "../esp-mbedtls-sys" }
log = "0.4.17"
embedded-io = "0.4.0"
esp32-hal = { version = "0.15.0", optional = true }
esp32c3-hal = { version = "0.12.0", optional = true }
esp32s2-hal = { version = "0.12.0", optional = true }
esp32s3-hal = { version = "0.12.0", optional = true }
embedded-io = { version = "0.6.1" }
embedded-io-async = { version = "0.6.0", optional = true }
esp32-hal = { version = "0.16.0", optional = true }
esp32c3-hal = { version = "0.13.0", optional = true }
esp32s2-hal = { version = "0.13.0", optional = true }
esp32s3-hal = { version = "0.13.0", optional = true }

[features]
async = ["embedded-io/async"]
async = ["dep:embedded-io-async"]
esp32 = ["esp32-hal", "esp-mbedtls-sys/esp32"]
esp32c3 = ["esp32c3-hal", "esp-mbedtls-sys/esp32c3"]
esp32s2 = ["esp32s2-hal", "esp-mbedtls-sys/esp32s2"]
Expand Down
28 changes: 15 additions & 13 deletions esp-mbedtls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#![feature(impl_trait_projections)]
#![allow(incomplete_features)]

use embedded_io::ErrorType;
#[doc(hidden)]
#[cfg(feature = "esp32")]
pub use esp32_hal as hal;
Expand All @@ -23,9 +24,8 @@ use core::ffi::CStr;
use core::mem::size_of;

use compat::StrBuf;
use embedded_io::blocking::Read;
use embedded_io::blocking::Write;
use embedded_io::Io;
use embedded_io::Read;
use embedded_io::Write;
use esp_mbedtls_sys::bindings::*;
use esp_mbedtls_sys::c_types::*;

Expand Down Expand Up @@ -535,7 +535,7 @@ where
session: Session<'a, T>,
}

impl<'a, T> Io for ConnectedSession<'a, T>
impl<'a, T> ErrorType for ConnectedSession<'a, T>
where
T: Read + Write,
{
Expand Down Expand Up @@ -577,7 +577,6 @@ where
#[cfg(feature = "async")]
pub mod asynch {
use super::*;
use embedded_io::asynch;

pub struct Session<'a, T, const BUFFER_SIZE: usize = 4096> {
stream: &'a mut T,
Expand Down Expand Up @@ -636,7 +635,7 @@ pub mod asynch {

impl<'a, T, const BUFFER_SIZE: usize> Session<'a, T, BUFFER_SIZE>
where
T: asynch::Read + asynch::Write,
T: embedded_io_async::Read + embedded_io_async::Write,
{
pub async fn connect<'b>(
mut self,
Expand Down Expand Up @@ -844,21 +843,23 @@ pub mod asynch {

pub struct AsyncConnectedSession<'a, T, const BUFFER_SIZE: usize>
where
T: asynch::Read + asynch::Write,
T: embedded_io_async::Read + embedded_io_async::Write,
{
pub(crate) session: Session<'a, T, BUFFER_SIZE>,
}

impl<'a, T, const BUFFER_SIZE: usize> Io for AsyncConnectedSession<'a, T, BUFFER_SIZE>
impl<'a, T, const BUFFER_SIZE: usize> embedded_io_async::ErrorType
for AsyncConnectedSession<'a, T, BUFFER_SIZE>
where
T: asynch::Read + asynch::Write,
T: embedded_io_async::Read + embedded_io_async::Write,
{
type Error = TlsError;
}

impl<'a, T, const BUFFER_SIZE: usize> asynch::Read for AsyncConnectedSession<'a, T, BUFFER_SIZE>
impl<'a, T, const BUFFER_SIZE: usize> embedded_io_async::Read
for AsyncConnectedSession<'a, T, BUFFER_SIZE>
where
T: asynch::Read + asynch::Write,
T: embedded_io_async::Read + embedded_io_async::Write,
{
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
log::debug!("async read called");
Expand All @@ -878,9 +879,10 @@ pub mod asynch {
}
}

impl<'a, T, const BUFFER_SIZE: usize> asynch::Write for AsyncConnectedSession<'a, T, BUFFER_SIZE>
impl<'a, T, const BUFFER_SIZE: usize> embedded_io_async::Write
for AsyncConnectedSession<'a, T, BUFFER_SIZE>
where
T: asynch::Read + asynch::Write,
T: embedded_io_async::Read + embedded_io_async::Write,
{
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
let res = self.session.async_internal_write(buf).await?;
Expand Down
Loading

0 comments on commit fcc50ea

Please sign in to comment.