From 583555bc8ae58f615bff000277220d043eeb9827 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 14 Jan 2024 23:20:51 +0100 Subject: [PATCH] Suppress "unused" warnings. --- embassy-stm32/src/usb/usb.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index 364076739..f39915906 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs @@ -13,7 +13,6 @@ use embassy_usb_driver::{ }; use super::{DmPin, DpPin, Instance}; -use crate::gpio::sealed::AFType; use crate::interrupt::typelevel::Interrupt; use crate::pac::usb::regs; use crate::pac::usb::vals::{EpType, Stat}; @@ -287,10 +286,12 @@ impl<'d, T: Instance> Driver<'d, T> { regs.btable().write(|w| w.set_btable(0)); #[cfg(not(stm32l1))] - dp.set_as_af(dp.af_num(), AFType::OutputPushPull); - - #[cfg(not(stm32l1))] - dm.set_as_af(dm.af_num(), AFType::OutputPushPull); + { + dp.set_as_af(dp.af_num(), crate::gpio::sealed::AFType::OutputPushPull); + dm.set_as_af(dm.af_num(), crate::gpio::sealed::AFType::OutputPushPull); + } + #[cfg(stm32l1)] + let _ = (dp, dm); // suppress "unused" warnings. // Initialize the bus so that it signals that power is available BUS_WAKER.wake();