aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-08-13 15:37:30 +0200
committerDario Nieuwenhuis <[email protected]>2022-08-13 15:37:30 +0200
commitf76815d642064b5ed5b1673e4a386e2747813f20 (patch)
tree55c5faeb15b23914220959ea38254e6cd9cc69f7 /examples
parent3388b5cecf95d6b0bc9cf5c952e9f0aa1e019b8a (diff)
Update Embassy.
Diffstat (limited to 'examples')
-rw-r--r--examples/rpi-pico-w/Cargo.toml13
-rw-r--r--examples/rpi-pico-w/src/main.rs17
2 files changed, 16 insertions, 14 deletions
diff --git a/examples/rpi-pico-w/Cargo.toml b/examples/rpi-pico-w/Cargo.toml
index 9e1d75470..af558d8cd 100644
--- a/examples/rpi-pico-w/Cargo.toml
+++ b/examples/rpi-pico-w/Cargo.toml
@@ -6,7 +6,8 @@ edition = "2021"
6 6
7[dependencies] 7[dependencies]
8cyw43 = { path = "../../", features = ["defmt"]} 8cyw43 = { path = "../../", features = ["defmt"]}
9embassy = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] } 9embassy-executor = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] }
10embassy-util = { version = "0.1.0" }
10embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } 11embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] }
11embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } 12embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] }
12atomic-polyfill = "0.1.5" 13atomic-polyfill = "0.1.5"
@@ -26,10 +27,12 @@ heapless = "0.7.15"
26 27
27 28
28[patch.crates-io] 29[patch.crates-io]
29embassy = { git = "https://github.com/embassy-rs/embassy", rev = "5f43c1d37e9db847c7861fe0bd821db62edba9f6" } 30embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" }
30embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "5f43c1d37e9db847c7861fe0bd821db62edba9f6" } 31embassy-util = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" }
31embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "5f43c1d37e9db847c7861fe0bd821db62edba9f6" } 32embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" }
32#embassy = { path = "/home/dirbaio/embassy/embassy/embassy" } 33embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" }
34#embassy-executor = { path = "/home/dirbaio/embassy/embassy/embassy-executor" }
35#embassy-util = { path = "/home/dirbaio/embassy/embassy/embassy-util" }
33#embassy-rp = { path = "/home/dirbaio/embassy/embassy/embassy-rp" } 36#embassy-rp = { path = "/home/dirbaio/embassy/embassy/embassy-rp" }
34#embassy-net = { path = "/home/dirbaio/embassy/embassy/embassy-net" } 37#embassy-net = { path = "/home/dirbaio/embassy/embassy/embassy-net" }
35#smoltcp = { path = "./smoltcp" } 38#smoltcp = { path = "./smoltcp" }
diff --git a/examples/rpi-pico-w/src/main.rs b/examples/rpi-pico-w/src/main.rs
index 3e966d212..91f087262 100644
--- a/examples/rpi-pico-w/src/main.rs
+++ b/examples/rpi-pico-w/src/main.rs
@@ -5,15 +5,14 @@
5use core::convert::Infallible; 5use core::convert::Infallible;
6use core::future::Future; 6use core::future::Future;
7 7
8use defmt::{assert, assert_eq, panic, *}; 8use defmt::*;
9use embassy::executor::Spawner; 9use embassy_executor::executor::Spawner;
10use embassy::time::{Duration, Timer};
11use embassy::util::Forever;
12use embassy_net::tcp::TcpSocket; 10use embassy_net::tcp::TcpSocket;
13use embassy_net::{Ipv4Address, Ipv4Cidr, Stack, StackResources}; 11use embassy_net::{Stack, StackResources};
14use embassy_rp::gpio::{Flex, Level, Output, Pin}; 12use embassy_rp::gpio::{Flex, Level, Output};
15use embassy_rp::peripherals::{PIN_23, PIN_24, PIN_25, PIN_29}; 13use embassy_rp::peripherals::{PIN_23, PIN_24, PIN_25, PIN_29};
16use embassy_rp::Peripherals; 14use embassy_rp::Peripherals;
15use embassy_util::Forever;
17use embedded_hal_1::spi::ErrorType; 16use embedded_hal_1::spi::ErrorType;
18use embedded_hal_async::spi::{ExclusiveDevice, SpiBusFlush, SpiBusRead, SpiBusWrite}; 17use embedded_hal_async::spi::{ExclusiveDevice, SpiBusFlush, SpiBusRead, SpiBusWrite};
19use embedded_io::asynch::{Read, Write}; 18use embedded_io::asynch::{Read, Write};
@@ -27,19 +26,19 @@ macro_rules! forever {
27 }}; 26 }};
28} 27}
29 28
30#[embassy::task] 29#[embassy_executor::task]
31async fn wifi_task( 30async fn wifi_task(
32 runner: cyw43::Runner<'static, Output<'static, PIN_23>, ExclusiveDevice<MySpi, Output<'static, PIN_25>>>, 31 runner: cyw43::Runner<'static, Output<'static, PIN_23>, ExclusiveDevice<MySpi, Output<'static, PIN_25>>>,
33) -> ! { 32) -> ! {
34 runner.run().await 33 runner.run().await
35} 34}
36 35
37#[embassy::task] 36#[embassy_executor::task]
38async fn net_task(stack: &'static Stack<cyw43::NetDevice<'static>>) -> ! { 37async fn net_task(stack: &'static Stack<cyw43::NetDevice<'static>>) -> ! {
39 stack.run().await 38 stack.run().await
40} 39}
41 40
42#[embassy::main] 41#[embassy_executor::main]
43async fn main(spawner: Spawner, p: Peripherals) { 42async fn main(spawner: Spawner, p: Peripherals) {
44 info!("Hello World!"); 43 info!("Hello World!");
45 44