diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-05-19 16:10:41 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-19 16:10:41 +0200 |
| commit | 55e4a89819b68a8c3c8e54b50901ac96b08dd710 (patch) | |
| tree | 548add4d3a59721a1463116c5067167129c9291d | |
| parent | 4b303949bff82cb328b75e37e9e03038d8d0e778 (diff) | |
| parent | a521a9b5ce78be01ed626c66bfad5e6fd9b11d32 (diff) | |
Merge pull request #1467 from embassy-rs/stm32-usb-no-time
stm32/usb: do not require embassy-time.
| -rwxr-xr-x | ci.sh | 14 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usb/usb.rs | 6 |
3 files changed, 19 insertions, 3 deletions
| @@ -46,6 +46,20 @@ cargo batch \ | |||
| 46 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ | 46 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ |
| 47 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ | 47 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ |
| 48 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \ | 48 | --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,intrinsics \ |
| 49 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any,unstable-traits \ | ||
| 50 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,time-driver-any \ | ||
| 51 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any \ | ||
| 52 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,time-driver-any,unstable-traits \ | ||
| 53 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti \ | ||
| 54 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt,exti,unstable-traits \ | ||
| 55 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,defmt \ | ||
| 56 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,time-driver-any,unstable-traits \ | ||
| 57 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,time-driver-any \ | ||
| 58 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,time-driver-any \ | ||
| 59 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,time-driver-any,unstable-traits \ | ||
| 60 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti \ | ||
| 61 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt,exti,unstable-traits \ | ||
| 62 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,nightly,defmt \ | ||
| 49 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits \ | 63 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,unstable-traits \ |
| 50 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits \ | 64 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,unstable-traits \ |
| 51 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f413vh,defmt,exti,time-driver-any,unstable-traits \ | 65 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f413vh,defmt,exti,time-driver-any,unstable-traits \ |
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)); |
