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-embedded-hal | |
| parent | 7559f9e5834799b041d899767ef4305dcfdf0181 (diff) | |
time: Update examples, tests, and other code to use new Timer::after_x convenience methods
Diffstat (limited to 'embassy-embedded-hal')
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/asynch/spi.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs index b2a9f1e33..5d3cf658a 100644 --- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs | |||
| @@ -76,9 +76,7 @@ where | |||
| 76 | #[cfg(not(feature = "time"))] | 76 | #[cfg(not(feature = "time"))] |
| 77 | Operation::DelayUs(_) => return Err(SpiDeviceError::DelayUsNotSupported), | 77 | Operation::DelayUs(_) => return Err(SpiDeviceError::DelayUsNotSupported), |
| 78 | #[cfg(feature = "time")] | 78 | #[cfg(feature = "time")] |
| 79 | Operation::DelayUs(us) => { | 79 | Operation::DelayUs(us) => embassy_time::Timer::after_micros(*us as _).await, |
| 80 | embassy_time::Timer::after(embassy_time::Duration::from_micros(*us as _)).await | ||
| 81 | } | ||
| 82 | } | 80 | } |
| 83 | } | 81 | } |
| 84 | }; | 82 | }; |
| @@ -143,9 +141,7 @@ where | |||
| 143 | #[cfg(not(feature = "time"))] | 141 | #[cfg(not(feature = "time"))] |
| 144 | Operation::DelayUs(_) => return Err(SpiDeviceError::DelayUsNotSupported), | 142 | Operation::DelayUs(_) => return Err(SpiDeviceError::DelayUsNotSupported), |
| 145 | #[cfg(feature = "time")] | 143 | #[cfg(feature = "time")] |
| 146 | Operation::DelayUs(us) => { | 144 | Operation::DelayUs(us) => embassy_time::Timer::after_micros(*us as _).await, |
| 147 | embassy_time::Timer::after(embassy_time::Duration::from_micros(*us as _)).await | ||
| 148 | } | ||
| 149 | } | 145 | } |
| 150 | } | 146 | } |
| 151 | }; | 147 | }; |
