diff options
| author | elagil <[email protected]> | 2025-03-16 22:02:43 +0100 |
|---|---|---|
| committer | elagil <[email protected]> | 2025-03-16 22:02:43 +0100 |
| commit | 63f7a5da09b150de5077c02c5b1394af4d012676 (patch) | |
| tree | 0fd91ec7408b72d341668dbf86bb7e5bf844b4ab | |
| parent | f1db070f78ddbef92c8e14db43b4422b9a14c926 (diff) | |
fix: disable `new_with_sof` for STM32L1
| -rw-r--r-- | embassy-stm32/src/usb/usb.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index af639fc9b..64ab3b669 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs | |||
| @@ -288,6 +288,7 @@ pub struct Driver<'d, T: Instance> { | |||
| 288 | 288 | ||
| 289 | impl<'d, T: Instance> Driver<'d, T> { | 289 | impl<'d, T: Instance> Driver<'d, T> { |
| 290 | /// Create a new USB driver with start-of-frame (SOF) output. | 290 | /// Create a new USB driver with start-of-frame (SOF) output. |
| 291 | #[cfg(not(stm32l1))] | ||
| 291 | pub fn new_with_sof( | 292 | pub fn new_with_sof( |
| 292 | _usb: impl Peripheral<P = T> + 'd, | 293 | _usb: impl Peripheral<P = T> + 'd, |
| 293 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 294 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| @@ -296,13 +297,10 @@ impl<'d, T: Instance> Driver<'d, T> { | |||
| 296 | sof: impl Peripheral<P = impl SofPin<T>> + 'd, | 297 | sof: impl Peripheral<P = impl SofPin<T>> + 'd, |
| 297 | ) -> Self { | 298 | ) -> Self { |
| 298 | into_ref!(sof); | 299 | into_ref!(sof); |
| 299 | #[cfg(not(stm32l1))] | ||
| 300 | { | 300 | { |
| 301 | use crate::gpio::{AfType, OutputType, Speed}; | 301 | use crate::gpio::{AfType, OutputType, Speed}; |
| 302 | sof.set_as_af(sof.af_num(), AfType::output(OutputType::PushPull, Speed::VeryHigh)); | 302 | sof.set_as_af(sof.af_num(), AfType::output(OutputType::PushPull, Speed::VeryHigh)); |
| 303 | } | 303 | } |
| 304 | #[cfg(stm32l1)] | ||
| 305 | let _ = sof; // suppress "unused" warning. | ||
| 306 | 304 | ||
| 307 | Self::new(_usb, _irq, dp, dm) | 305 | Self::new(_usb, _irq, dp, dm) |
| 308 | } | 306 | } |
