diff options
| author | Adam Greig <[email protected]> | 2023-10-15 00:57:25 +0100 |
|---|---|---|
| committer | Adam Greig <[email protected]> | 2023-10-15 01:30:12 +0100 |
| commit | 0621e957a0ddc7010d46b3ea3ddc8b9852bc8333 (patch) | |
| tree | f6caefe939109e55a73e9141c736d2f6c20f51e8 /embassy-net-wiznet | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (diff) | |
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'embassy-net-wiznet')
| -rw-r--r-- | embassy-net-wiznet/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-net-wiznet/src/lib.rs b/embassy-net-wiznet/src/lib.rs index 3030dfb90..48d17cac2 100644 --- a/embassy-net-wiznet/src/lib.rs +++ b/embassy-net-wiznet/src/lib.rs | |||
| @@ -8,7 +8,7 @@ mod device; | |||
| 8 | use embassy_futures::select::{select, Either}; | 8 | use embassy_futures::select::{select, Either}; |
| 9 | use embassy_net_driver_channel as ch; | 9 | use embassy_net_driver_channel as ch; |
| 10 | use embassy_net_driver_channel::driver::LinkState; | 10 | use embassy_net_driver_channel::driver::LinkState; |
| 11 | use embassy_time::{Duration, Timer}; | 11 | use embassy_time::Timer; |
| 12 | use embedded_hal::digital::OutputPin; | 12 | use embedded_hal::digital::OutputPin; |
| 13 | use embedded_hal_async::digital::Wait; | 13 | use embedded_hal_async::digital::Wait; |
| 14 | use embedded_hal_async::spi::SpiDevice; | 14 | use embedded_hal_async::spi::SpiDevice; |
| @@ -95,12 +95,12 @@ pub async fn new<'a, const N_RX: usize, const N_TX: usize, C: Chip, SPI: SpiDevi | |||
| 95 | // Reset the chip. | 95 | // Reset the chip. |
| 96 | reset.set_low().ok(); | 96 | reset.set_low().ok(); |
| 97 | // Ensure the reset is registered. | 97 | // Ensure the reset is registered. |
| 98 | Timer::after(Duration::from_millis(1)).await; | 98 | Timer::after_millis(1).await; |
| 99 | reset.set_high().ok(); | 99 | reset.set_high().ok(); |
| 100 | 100 | ||
| 101 | // Wait for PLL lock. Some chips are slower than others. | 101 | // Wait for PLL lock. Some chips are slower than others. |
| 102 | // Slowest is w5100s which is 100ms, so let's just wait that. | 102 | // Slowest is w5100s which is 100ms, so let's just wait that. |
| 103 | Timer::after(Duration::from_millis(100)).await; | 103 | Timer::after_millis(100).await; |
| 104 | 104 | ||
| 105 | let mac = WiznetDevice::new(spi_dev, mac_addr).await.unwrap(); | 105 | let mac = WiznetDevice::new(spi_dev, mac_addr).await.unwrap(); |
| 106 | 106 | ||
