Skip to content

Commit 9f7a32a

Browse files
elagilferris
authored andcommitted
fix: disable new_with_sof for STM32L1
1 parent 81f94ad commit 9f7a32a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

embassy-stm32/src/usb/usb.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ pub struct Driver<'d, T: Instance> {
293293

294294
impl<'d, T: Instance> Driver<'d, T> {
295295
/// Create a new USB driver with start-of-frame (SOF) output.
296+
#[cfg(not(stm32l1))]
296297
pub fn new_with_sof(
297298
_usb: impl Peripheral<P = T> + 'd,
298299
_irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
@@ -301,13 +302,10 @@ impl<'d, T: Instance> Driver<'d, T> {
301302
sof: impl Peripheral<P = impl SofPin<T>> + 'd,
302303
) -> Self {
303304
into_ref!(sof);
304-
#[cfg(not(stm32l1))]
305305
{
306306
use crate::gpio::{AfType, OutputType, Speed};
307307
sof.set_as_af(sof.af_num(), AfType::output(OutputType::PushPull, Speed::VeryHigh));
308308
}
309-
#[cfg(stm32l1)]
310-
let _ = sof; // suppress "unused" warning.
311309

312310
Self::new(_usb, _irq, dp, dm)
313311
}

0 commit comments

Comments
 (0)