embassy-usb: fix building with optional log feature

This commit is contained in:
9names 2024-12-28 23:41:36 +11:00
parent b71696c8f5
commit adf3134e7d
2 changed files with 7 additions and 1 deletions

View File

@ -579,7 +579,7 @@ impl<'d> Control<'d> {
if endpoint_address != self.streaming_endpoint_address { if endpoint_address != self.streaming_endpoint_address {
debug!( debug!(
"Unhandled endpoint set request for endpoint {} and control {} with data {}", "Unhandled endpoint set request for endpoint {} and control {} with data {:?}",
endpoint_address, control_selector, data endpoint_address, control_selector, data
); );
return None; return None;

View File

@ -18,6 +18,12 @@ impl From<InterfaceNumber> for u8 {
} }
} }
impl core::fmt::Display for InterfaceNumber {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{}", self.0)
}
}
/// A handle for a USB string descriptor that contains its index. /// A handle for a USB string descriptor that contains its index.
#[derive(Copy, Clone, Eq, PartialEq)] #[derive(Copy, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "defmt", derive(defmt::Format))]