diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-08-07 13:43:09 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-07 13:43:09 +0200 |
| commit | 5d5cd2371504915a531e669dce3558485a51a2e1 (patch) | |
| tree | 5d0093e9e5005d3a946e92686a9dc79565c3043f /examples/std | |
| parent | 77844e2055319e1af7dd50fdb2e39ef88c6a5010 (diff) | |
Update to embedded-io 0.5 (#1752)
Diffstat (limited to 'examples/std')
| -rw-r--r-- | examples/std/Cargo.toml | 5 | ||||
| -rw-r--r-- | examples/std/src/bin/net.rs | 2 | ||||
| -rw-r--r-- | examples/std/src/bin/serial.rs | 4 | ||||
| -rw-r--r-- | examples/std/src/bin/tcp_accept.rs | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 544176828..3e26d2e2f 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -8,9 +8,10 @@ license = "MIT OR Apache-2.0" | |||
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["log", "std", "nightly"] } | 10 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["log", "std", "nightly"] } |
| 11 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "tcp", "udp", "dns", "dhcpv4", "unstable-traits", "proto-ipv6"] } | 11 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } |
| 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } | 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } |
| 13 | embedded-io = { version = "0.4.0", features = ["async", "std", "futures"] } | 13 | embedded-io-async = { version = "0.5.0" } |
| 14 | embedded-io-adapters = { version = "0.5.0", features = ["futures-03"] } | ||
| 14 | critical-section = { version = "1.1", features = ["std"] } | 15 | critical-section = { version = "1.1", features = ["std"] } |
| 15 | 16 | ||
| 16 | async-io = "1.6.0" | 17 | async-io = "1.6.0" |
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index e0de14162..8d8345057 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -8,7 +8,7 @@ use embassy_net::tcp::TcpSocket; | |||
| 8 | use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; | 8 | use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; |
| 9 | use embassy_net_tuntap::TunTapDevice; | 9 | use embassy_net_tuntap::TunTapDevice; |
| 10 | use embassy_time::Duration; | 10 | use embassy_time::Duration; |
| 11 | use embedded_io::asynch::Write; | 11 | use embedded_io_async::Write; |
| 12 | use heapless::Vec; | 12 | use heapless::Vec; |
| 13 | use log::*; | 13 | use log::*; |
| 14 | use rand_core::{OsRng, RngCore}; | 14 | use rand_core::{OsRng, RngCore}; |
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs index 85ee54f70..0b289c74d 100644 --- a/examples/std/src/bin/serial.rs +++ b/examples/std/src/bin/serial.rs | |||
| @@ -5,7 +5,7 @@ mod serial_port; | |||
| 5 | 5 | ||
| 6 | use async_io::Async; | 6 | use async_io::Async; |
| 7 | use embassy_executor::Executor; | 7 | use embassy_executor::Executor; |
| 8 | use embedded_io::asynch::Read; | 8 | use embedded_io_async::Read; |
| 9 | use log::*; | 9 | use log::*; |
| 10 | use nix::sys::termios; | 10 | use nix::sys::termios; |
| 11 | use static_cell::StaticCell; | 11 | use static_cell::StaticCell; |
| @@ -29,7 +29,7 @@ async fn run() { | |||
| 29 | // | 29 | // |
| 30 | // This is not really needed, you could write the code below using futures::io directly. | 30 | // This is not really needed, you could write the code below using futures::io directly. |
| 31 | // It's useful if you want to have portable code across embedded and std. | 31 | // It's useful if you want to have portable code across embedded and std. |
| 32 | let mut port = embedded_io::adapters::FromFutures::new(port); | 32 | let mut port = embedded_io_adapters::futures_03::FromFutures::new(port); |
| 33 | 33 | ||
| 34 | info!("Serial opened!"); | 34 | info!("Serial opened!"); |
| 35 | 35 | ||
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs index 0c920a3fb..199e4c9ec 100644 --- a/examples/std/src/bin/tcp_accept.rs +++ b/examples/std/src/bin/tcp_accept.rs | |||
| @@ -9,7 +9,7 @@ use embassy_net::tcp::TcpSocket; | |||
| 9 | use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; | 9 | use embassy_net::{Config, Ipv4Address, Ipv4Cidr, Stack, StackResources}; |
| 10 | use embassy_net_tuntap::TunTapDevice; | 10 | use embassy_net_tuntap::TunTapDevice; |
| 11 | use embassy_time::{Duration, Timer}; | 11 | use embassy_time::{Duration, Timer}; |
| 12 | use embedded_io::asynch::Write as _; | 12 | use embedded_io_async::Write as _; |
| 13 | use heapless::Vec; | 13 | use heapless::Vec; |
| 14 | use log::*; | 14 | use log::*; |
| 15 | use rand_core::{OsRng, RngCore}; | 15 | use rand_core::{OsRng, RngCore}; |
