diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-05-19 15:20:37 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-05-19 15:20:37 +0200 |
| commit | f43d57846e010459b8eafcf16ec826cbbf8669e9 (patch) | |
| tree | 0002d8eb243af726c28f33f581d4debd1a42fb55 /embassy-stm32 | |
| parent | 4b303949bff82cb328b75e37e9e03038d8d0e778 (diff) | |
stm32/usb: do not require embassy-time.
Fixes #1466
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/src/lib.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usb/usb.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 1b6f83c3e..3283c4062 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -58,7 +58,7 @@ pub mod spi; | |||
| 58 | pub mod tl_mbox; | 58 | pub mod tl_mbox; |
| 59 | #[cfg(usart)] | 59 | #[cfg(usart)] |
| 60 | pub mod usart; | 60 | pub mod usart; |
| 61 | #[cfg(all(usb, feature = "time"))] | 61 | #[cfg(usb)] |
| 62 | pub mod usb; | 62 | pub mod usb; |
| 63 | #[cfg(otg)] | 63 | #[cfg(otg)] |
| 64 | pub mod usb_otg; | 64 | pub mod usb_otg; |
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index ad68eaba2..56c46476c 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs | |||
| @@ -7,7 +7,6 @@ use core::task::Poll; | |||
| 7 | 7 | ||
| 8 | use embassy_hal_common::into_ref; | 8 | use embassy_hal_common::into_ref; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | 9 | use embassy_sync::waitqueue::AtomicWaker; |
| 10 | use embassy_time::{block_for, Duration}; | ||
| 11 | use embassy_usb_driver as driver; | 10 | use embassy_usb_driver as driver; |
| 12 | use embassy_usb_driver::{ | 11 | use embassy_usb_driver::{ |
| 13 | Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointInfo, EndpointType, Event, Unsupported, | 12 | Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointInfo, EndpointType, Event, Unsupported, |
| @@ -200,7 +199,10 @@ impl<'d, T: Instance> Driver<'d, T> { | |||
| 200 | w.set_fres(true); | 199 | w.set_fres(true); |
| 201 | }); | 200 | }); |
| 202 | 201 | ||
| 203 | block_for(Duration::from_millis(100)); | 202 | #[cfg(time)] |
| 203 | embassy_time::block_for(embassy_time::Duration::from_millis(100)); | ||
| 204 | #[cfg(not(time))] | ||
| 205 | cortex_m::asm::delay(crate::rcc::get_freqs().sys.0 / 10); | ||
| 204 | 206 | ||
| 205 | #[cfg(not(usb_v4))] | 207 | #[cfg(not(usb_v4))] |
| 206 | regs.btable().write(|w| w.set_btable(0)); | 208 | regs.btable().write(|w| w.set_btable(0)); |
