diff options
Diffstat (limited to 'examples/nrf52840')
| -rw-r--r-- | examples/nrf52840/Cargo.toml | 5 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/wifi_esp_hosted.rs | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml index 8c4175966..2ccd5045f 100644 --- a/examples/nrf52840/Cargo.toml +++ b/examples/nrf52840/Cargo.toml | |||
| @@ -52,4 +52,7 @@ rand = { version = "0.8.4", default-features = false } | |||
| 52 | embedded-storage = "0.3.0" | 52 | embedded-storage = "0.3.0" |
| 53 | usbd-hid = "0.6.0" | 53 | usbd-hid = "0.6.0" |
| 54 | serde = { version = "1.0.136", default-features = false } | 54 | serde = { version = "1.0.136", default-features = false } |
| 55 | embedded-hal-async = { version = "0.2.0-alpha.1", optional = true } | 55 | embedded-hal-async = { version = "0.2.0-alpha.2", optional = true } |
| 56 | |||
| 57 | [patch.crates-io] | ||
| 58 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "ad289428fd44b02788e2fa2116445cc8f640a265" } | ||
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs index 4eb31b105..f7496703c 100644 --- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs +++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs | |||
| @@ -10,6 +10,7 @@ use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull}; | |||
| 10 | use embassy_nrf::rng::Rng; | 10 | use embassy_nrf::rng::Rng; |
| 11 | use embassy_nrf::spim::{self, Spim}; | 11 | use embassy_nrf::spim::{self, Spim}; |
| 12 | use embassy_nrf::{bind_interrupts, peripherals}; | 12 | use embassy_nrf::{bind_interrupts, peripherals}; |
| 13 | use embassy_time::Delay; | ||
| 13 | use embedded_hal_async::spi::ExclusiveDevice; | 14 | use embedded_hal_async::spi::ExclusiveDevice; |
| 14 | use embedded_io::asynch::Write; | 15 | use embedded_io::asynch::Write; |
| 15 | use static_cell::make_static; | 16 | use static_cell::make_static; |
| @@ -24,7 +25,7 @@ bind_interrupts!(struct Irqs { | |||
| 24 | async fn wifi_task( | 25 | async fn wifi_task( |
| 25 | runner: hosted::Runner< | 26 | runner: hosted::Runner< |
| 26 | 'static, | 27 | 'static, |
| 27 | ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static, peripherals::P0_31>>, | 28 | ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static, peripherals::P0_31>, Delay>, |
| 28 | Input<'static, AnyPin>, | 29 | Input<'static, AnyPin>, |
| 29 | Output<'static, peripherals::P1_05>, | 30 | Output<'static, peripherals::P1_05>, |
| 30 | >, | 31 | >, |
| @@ -55,7 +56,7 @@ async fn main(spawner: Spawner) { | |||
| 55 | config.frequency = spim::Frequency::M32; | 56 | config.frequency = spim::Frequency::M32; |
| 56 | config.mode = spim::MODE_2; // !!! | 57 | config.mode = spim::MODE_2; // !!! |
| 57 | let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); | 58 | let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); |
| 58 | let spi = ExclusiveDevice::new(spi, cs); | 59 | let spi = ExclusiveDevice::new(spi, cs, Delay); |
| 59 | 60 | ||
| 60 | let (device, mut control, runner) = embassy_net_esp_hosted::new( | 61 | let (device, mut control, runner) = embassy_net_esp_hosted::new( |
| 61 | make_static!(embassy_net_esp_hosted::State::new()), | 62 | make_static!(embassy_net_esp_hosted::State::new()), |
