diff options
| -rw-r--r-- | embassy-net-wiznet/src/lib.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/eth_w5500.rs | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/embassy-net-wiznet/src/lib.rs b/embassy-net-wiznet/src/lib.rs index 545b2a2e4..90102196a 100644 --- a/embassy-net-wiznet/src/lib.rs +++ b/embassy-net-wiznet/src/lib.rs | |||
| @@ -29,7 +29,7 @@ pub type Device<'d> = embassy_net_driver_channel::Device<'d, MTU>; | |||
| 29 | /// send packet queue. With a the ethernet MTU of _1514_ this takes up `N_RX + | 29 | /// send packet queue. With a the ethernet MTU of _1514_ this takes up `N_RX + |
| 30 | /// NTX * 1514` bytes. While setting these both to 1 is the minimum this might | 30 | /// NTX * 1514` bytes. While setting these both to 1 is the minimum this might |
| 31 | /// hurt performance as a packet can not be received while processing another. | 31 | /// hurt performance as a packet can not be received while processing another. |
| 32 | /// | 32 | /// |
| 33 | /// # Warning | 33 | /// # Warning |
| 34 | /// On devices with a small amount of ram (think ~64k) watch out with the size | 34 | /// On devices with a small amount of ram (think ~64k) watch out with the size |
| 35 | /// of there parameters. They will quickly use too much RAM. | 35 | /// of there parameters. They will quickly use too much RAM. |
diff --git a/examples/stm32f4/src/bin/eth_w5500.rs b/examples/stm32f4/src/bin/eth_w5500.rs index 827e74c51..c51111110 100644 --- a/examples/stm32f4/src/bin/eth_w5500.rs +++ b/examples/stm32f4/src/bin/eth_w5500.rs | |||
| @@ -5,17 +5,18 @@ use defmt::*; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_net::tcp::TcpSocket; | 6 | use embassy_net::tcp::TcpSocket; |
| 7 | use embassy_net::{Ipv4Address, Stack, StackResources}; | 7 | use embassy_net::{Ipv4Address, Stack, StackResources}; |
| 8 | use embassy_net_wiznet::{chip::W5500, Device, Runner, State}; | 8 | use embassy_net_wiznet::chip::W5500; |
| 9 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | 9 | use embassy_net_wiznet::{Device, Runner, State}; |
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | ||
| 12 | use embassy_stm32::mode::Async; | ||
| 11 | use embassy_stm32::rng::Rng; | 13 | use embassy_stm32::rng::Rng; |
| 12 | use embassy_stm32::spi::Spi; | 14 | use embassy_stm32::spi::Spi; |
| 13 | use embassy_stm32::mode::Async; | ||
| 14 | use embassy_stm32::time::Hertz; | 15 | use embassy_stm32::time::Hertz; |
| 15 | use embassy_stm32::{bind_interrupts, peripherals, rng, spi, Config}; | 16 | use embassy_stm32::{bind_interrupts, peripherals, rng, spi, Config}; |
| 16 | use embassy_time::{Timer, Delay}; | 17 | use embassy_time::{Delay, Timer}; |
| 17 | use embedded_io_async::Write; | ||
| 18 | use embedded_hal_bus::spi::ExclusiveDevice; | 18 | use embedded_hal_bus::spi::ExclusiveDevice; |
| 19 | use embedded_io_async::Write; | ||
| 19 | use static_cell::StaticCell; | 20 | use static_cell::StaticCell; |
| 20 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 21 | 22 | ||
| @@ -25,9 +26,7 @@ bind_interrupts!(struct Irqs { | |||
| 25 | 26 | ||
| 26 | type EthernetSPI = ExclusiveDevice<Spi<'static, Async>, Output<'static>, Delay>; | 27 | type EthernetSPI = ExclusiveDevice<Spi<'static, Async>, Output<'static>, Delay>; |
| 27 | #[embassy_executor::task] | 28 | #[embassy_executor::task] |
| 28 | async fn ethernet_task( | 29 | async fn ethernet_task(runner: Runner<'static, W5500, EthernetSPI, ExtiInput<'static>, Output<'static>>) -> ! { |
| 29 | runner: Runner<'static, W5500, EthernetSPI, ExtiInput<'static>, Output<'static>>, | ||
| 30 | ) -> ! { | ||
| 31 | runner.run().await | 30 | runner.run().await |
| 32 | } | 31 | } |
| 33 | 32 | ||
