aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-05-19 16:10:41 +0200
committerGitHub <[email protected]>2023-05-19 16:10:41 +0200
commit55e4a89819b68a8c3c8e54b50901ac96b08dd710 (patch)
tree548add4d3a59721a1463116c5067167129c9291d
parent4b303949bff82cb328b75e37e9e03038d8d0e778 (diff)
parenta521a9b5ce78be01ed626c66bfad5e6fd9b11d32 (diff)
Merge pull request #1467 from embassy-rs/stm32-usb-no-time
stm32/usb: do not require embassy-time.
-rwxr-xr-xci.sh14
-rw-r--r--embassy-stm32/src/lib.rs2
-rw-r--r--embassy-stm32/src/usb/usb.rs6
3 files changed, 19 insertions, 3 deletions
diff --git a/ci.sh b/ci.sh
index 4b7d73711..d2bf4df97 100755
--- a/ci.sh
+++ b/ci.sh
@@ -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;
58pub mod tl_mbox; 58pub mod tl_mbox;
59#[cfg(usart)] 59#[cfg(usart)]
60pub mod usart; 60pub mod usart;
61#[cfg(all(usb, feature = "time"))] 61#[cfg(usb)]
62pub mod usb; 62pub mod usb;
63#[cfg(otg)] 63#[cfg(otg)]
64pub mod usb_otg; 64pub 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
8use embassy_hal_common::into_ref; 8use embassy_hal_common::into_ref;
9use embassy_sync::waitqueue::AtomicWaker; 9use embassy_sync::waitqueue::AtomicWaker;
10use embassy_time::{block_for, Duration};
11use embassy_usb_driver as driver; 10use embassy_usb_driver as driver;
12use embassy_usb_driver::{ 11use 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));