diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-08-13 15:37:30 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-08-13 15:37:30 +0200 |
| commit | f76815d642064b5ed5b1673e4a386e2747813f20 (patch) | |
| tree | 55c5faeb15b23914220959ea38254e6cd9cc69f7 /examples | |
| parent | 3388b5cecf95d6b0bc9cf5c952e9f0aa1e019b8a (diff) | |
Update Embassy.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rpi-pico-w/Cargo.toml | 13 | ||||
| -rw-r--r-- | examples/rpi-pico-w/src/main.rs | 17 |
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] |
| 8 | cyw43 = { path = "../../", features = ["defmt"]} | 8 | cyw43 = { path = "../../", features = ["defmt"]} |
| 9 | embassy = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] } | 9 | embassy-executor = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] } |
| 10 | embassy-util = { version = "0.1.0" } | ||
| 10 | embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } | 11 | embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } |
| 11 | embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } | 12 | embassy-net = { version = "0.1.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } |
| 12 | atomic-polyfill = "0.1.5" | 13 | atomic-polyfill = "0.1.5" |
| @@ -26,10 +27,12 @@ heapless = "0.7.15" | |||
| 26 | 27 | ||
| 27 | 28 | ||
| 28 | [patch.crates-io] | 29 | [patch.crates-io] |
| 29 | embassy = { git = "https://github.com/embassy-rs/embassy", rev = "5f43c1d37e9db847c7861fe0bd821db62edba9f6" } | 30 | embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" } |
| 30 | embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "5f43c1d37e9db847c7861fe0bd821db62edba9f6" } | 31 | embassy-util = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" } |
| 31 | embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "5f43c1d37e9db847c7861fe0bd821db62edba9f6" } | 32 | embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "6ffca81a38d2c7f57da667ff49b4296c4eba78e2" } |
| 32 | #embassy = { path = "/home/dirbaio/embassy/embassy/embassy" } | 33 | embassy-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 @@ | |||
| 5 | use core::convert::Infallible; | 5 | use core::convert::Infallible; |
| 6 | use core::future::Future; | 6 | use core::future::Future; |
| 7 | 7 | ||
| 8 | use defmt::{assert, assert_eq, panic, *}; | 8 | use defmt::*; |
| 9 | use embassy::executor::Spawner; | 9 | use embassy_executor::executor::Spawner; |
| 10 | use embassy::time::{Duration, Timer}; | ||
| 11 | use embassy::util::Forever; | ||
| 12 | use embassy_net::tcp::TcpSocket; | 10 | use embassy_net::tcp::TcpSocket; |
| 13 | use embassy_net::{Ipv4Address, Ipv4Cidr, Stack, StackResources}; | 11 | use embassy_net::{Stack, StackResources}; |
| 14 | use embassy_rp::gpio::{Flex, Level, Output, Pin}; | 12 | use embassy_rp::gpio::{Flex, Level, Output}; |
| 15 | use embassy_rp::peripherals::{PIN_23, PIN_24, PIN_25, PIN_29}; | 13 | use embassy_rp::peripherals::{PIN_23, PIN_24, PIN_25, PIN_29}; |
| 16 | use embassy_rp::Peripherals; | 14 | use embassy_rp::Peripherals; |
| 15 | use embassy_util::Forever; | ||
| 17 | use embedded_hal_1::spi::ErrorType; | 16 | use embedded_hal_1::spi::ErrorType; |
| 18 | use embedded_hal_async::spi::{ExclusiveDevice, SpiBusFlush, SpiBusRead, SpiBusWrite}; | 17 | use embedded_hal_async::spi::{ExclusiveDevice, SpiBusFlush, SpiBusRead, SpiBusWrite}; |
| 19 | use embedded_io::asynch::{Read, Write}; | 18 | use 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] |
| 31 | async fn wifi_task( | 30 | async 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] |
| 38 | async fn net_task(stack: &'static Stack<cyw43::NetDevice<'static>>) -> ! { | 37 | async 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] |
| 43 | async fn main(spawner: Spawner, p: Peripherals) { | 42 | async fn main(spawner: Spawner, p: Peripherals) { |
| 44 | info!("Hello World!"); | 43 | info!("Hello World!"); |
| 45 | 44 | ||
