diff options
| author | Jared Szechy <[email protected]> | 2025-11-01 21:06:39 -0400 |
|---|---|---|
| committer | Jared Szechy <[email protected]> | 2025-11-01 21:06:39 -0400 |
| commit | c5d024e199374e97e049aa50afa4c44ce8a2c750 (patch) | |
| tree | 09d36ba4d24271f34828e74c0514fd05b97d75bf /examples | |
| parent | ea771315534296aca5bef7efa145a5c8f932b915 (diff) | |
| parent | cf231d461ff4b16cf7d16e4dbc5db909212c2c89 (diff) | |
Merge remote-tracking branch 'origin/main' into sdmmc-fix
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/src/bin/wifi_esp_hosted.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs index 07752ffc4..2f9c06b56 100644 --- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs +++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs | |||
| @@ -27,14 +27,12 @@ bind_interrupts!(struct Irqs { | |||
| 27 | async fn wifi_task( | 27 | async fn wifi_task( |
| 28 | runner: hosted::Runner< | 28 | runner: hosted::Runner< |
| 29 | 'static, | 29 | 'static, |
| 30 | ExclusiveDevice<Spim<'static>, Output<'static>, Delay>, | 30 | hosted::SpiInterface<ExclusiveDevice<Spim<'static>, Output<'static>, Delay>, Input<'static>>, |
| 31 | Input<'static>, | ||
| 32 | Output<'static>, | 31 | Output<'static>, |
| 33 | >, | 32 | >, |
| 34 | ) -> ! { | 33 | ) -> ! { |
| 35 | runner.run().await | 34 | runner.run().await |
| 36 | } | 35 | } |
| 37 | |||
| 38 | #[embassy_executor::task] | 36 | #[embassy_executor::task] |
| 39 | async fn net_task(mut runner: embassy_net::Runner<'static, hosted::NetDriver<'static>>) -> ! { | 37 | async fn net_task(mut runner: embassy_net::Runner<'static, hosted::NetDriver<'static>>) -> ! { |
| 40 | runner.run().await | 38 | runner.run().await |
| @@ -60,15 +58,11 @@ async fn main(spawner: Spawner) { | |||
| 60 | 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); |
| 61 | let spi = ExclusiveDevice::new(spi, cs, Delay); | 59 | let spi = ExclusiveDevice::new(spi, cs, Delay); |
| 62 | 60 | ||
| 61 | let iface = hosted::SpiInterface::new(spi, handshake, ready); | ||
| 62 | |||
| 63 | static ESP_STATE: StaticCell<embassy_net_esp_hosted::State> = StaticCell::new(); | 63 | static ESP_STATE: StaticCell<embassy_net_esp_hosted::State> = StaticCell::new(); |
| 64 | let (device, mut control, runner) = embassy_net_esp_hosted::new( | 64 | let (device, mut control, runner) = |
| 65 | ESP_STATE.init(embassy_net_esp_hosted::State::new()), | 65 | embassy_net_esp_hosted::new(ESP_STATE.init(embassy_net_esp_hosted::State::new()), iface, reset).await; |
| 66 | spi, | ||
| 67 | handshake, | ||
| 68 | ready, | ||
| 69 | reset, | ||
| 70 | ) | ||
| 71 | .await; | ||
| 72 | 66 | ||
| 73 | spawner.spawn(unwrap!(wifi_task(runner))); | 67 | spawner.spawn(unwrap!(wifi_task(runner))); |
| 74 | 68 | ||
