From f13d31089aef8a521798776377fa9e9ffeee4fcb Mon Sep 17 00:00:00 2001 From: Leon Loeser Date: Wed, 25 Sep 2024 16:46:03 +0200 Subject: [PATCH] Fix unused variable names --- embassy-nrf/src/usb/mod.rs | 12 ++++++++++++ embassy-stm32/src/usb/otg.rs | 16 +++++++++++++++- embassy-stm32/src/usb/usb.rs | 13 ++++++++++++- embassy-usb-synopsys-otg/src/lib.rs | 15 ++++++++++++++- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/embassy-nrf/src/usb/mod.rs b/embassy-nrf/src/usb/mod.rs index 50d631078a..2903f59110 100644 --- a/embassy-nrf/src/usb/mod.rs +++ b/embassy-nrf/src/usb/mod.rs @@ -171,10 +171,14 @@ impl<'d, T: Instance, V: VbusDetect + 'd> driver::Driver<'d> for Driver<'d, T, V } fn grow_endpoint_in_buffer(&mut self, ep: &mut Self::EndpointIn, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } fn grow_endpoint_out_buffer(&mut self, ep: &mut Self::EndpointOut, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } } @@ -318,18 +322,26 @@ impl<'d, T: Instance, V: VbusDetect> driver::Bus for Bus<'d, T, V> { } fn endpoint_set_buffersize(&mut self, ep_addr: EndpointAddress, buf_size: u16) { + let _ = ep_addr; + let _ = buf_size; warn!("Not implemented yet!!!"); } fn endpoint_set_sync_type(&mut self, ep_addr: EndpointAddress, synchronization_type: SynchronizationType) { + let _ = ep_addr; + let _ = synchronization_type; warn!("Not implemented yet!!!"); } fn endpoint_set_usage_type(&mut self, ep_addr: EndpointAddress, usage_type: UsageType) { + let _ = ep_addr; + let _ = usage_type; warn!("Not implemented yet!!!"); } fn endpoint_set_type(&mut self, ep_addr: EndpointAddress, ep_type: EndpointType) { + let _ = ep_addr; + let _ = ep_type; warn!("Not implemented yet!!!"); } diff --git a/embassy-stm32/src/usb/otg.rs b/embassy-stm32/src/usb/otg.rs index f3accd74ee..0ffcb3d98d 100644 --- a/embassy-stm32/src/usb/otg.rs +++ b/embassy-stm32/src/usb/otg.rs @@ -1,7 +1,9 @@ use core::marker::PhantomData; use embassy_hal_internal::{into_ref, Peripheral}; -use embassy_usb_driver::{EndpointAddress, EndpointAllocError, EndpointType, Event, SynchronizationType, Unsupported, UsageType}; +use embassy_usb_driver::{ + EndpointAddress, EndpointAllocError, EndpointType, Event, SynchronizationType, Unsupported, UsageType, +}; use embassy_usb_synopsys_otg::otg_v1::vals::Dspd; use embassy_usb_synopsys_otg::otg_v1::Otg; pub use embassy_usb_synopsys_otg::Config; @@ -236,10 +238,14 @@ impl<'d, T: Instance> embassy_usb_driver::Driver<'d> for Driver<'d, T> { } fn grow_endpoint_in_buffer(&mut self, ep: &mut Self::EndpointIn, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } fn grow_endpoint_out_buffer(&mut self, ep: &mut Self::EndpointOut, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } } @@ -329,18 +335,26 @@ impl<'d, T: Instance> embassy_usb_driver::Bus for Bus<'d, T> { } fn endpoint_set_buffersize(&mut self, ep_addr: EndpointAddress, buf_size: u16) { + let _ = ep_addr; + let _ = buf_size; warn!("Not implemented yet!!!"); } fn endpoint_set_sync_type(&mut self, ep_addr: EndpointAddress, synchronization_type: SynchronizationType) { + let _ = ep_addr; + let _ = synchronization_type; warn!("Not implemented yet!!!"); } fn endpoint_set_usage_type(&mut self, ep_addr: EndpointAddress, usage_type: UsageType) { + let _ = ep_addr; + let _ = usage_type; warn!("Not implemented yet!!!"); } fn endpoint_set_type(&mut self, ep_addr: EndpointAddress, ep_type: EndpointType) { + let _ = ep_addr; + let _ = ep_type; warn!("Not implemented yet!!!"); } diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index c41e7ecb3f..000ef72986 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs @@ -521,11 +521,14 @@ impl<'d, T: Instance> driver::Driver<'d> for Driver<'d, T> { } fn grow_endpoint_in_buffer(&mut self, ep: &mut Self::EndpointIn, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } - fn grow_endpoint_out_buffer(&mut self, ep: &mut Self::EndpointOut, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } } @@ -652,18 +655,26 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> { } fn endpoint_set_buffersize(&mut self, ep_addr: EndpointAddress, buf_size: u16) { + let _ = ep_addr; + let _ = buf_size; warn!("Not implemented yet!!!"); } fn endpoint_set_sync_type(&mut self, ep_addr: EndpointAddress, synchronization_type: SynchronizationType) { + let _ = ep_addr; + let _ = synchronization_type; warn!("Not implemented yet!!!"); } fn endpoint_set_usage_type(&mut self, ep_addr: EndpointAddress, usage_type: UsageType) { + let _ = ep_addr; + let _ = usage_type; warn!("Not implemented yet!!!"); } fn endpoint_set_type(&mut self, ep_addr: EndpointAddress, ep_type: EndpointType) { + let _ = ep_addr; + let _ = ep_type; warn!("Not implemented yet!!!"); } diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs index eadca4ebd8..79101c8557 100644 --- a/embassy-usb-synopsys-otg/src/lib.rs +++ b/embassy-usb-synopsys-otg/src/lib.rs @@ -14,7 +14,8 @@ use core::task::Poll; use embassy_sync::waitqueue::AtomicWaker; use embassy_usb_driver::{ - Bus as _, Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointIn, EndpointInfo, EndpointOut, EndpointType, Event, SynchronizationType, Unsupported, UsageType + Bus as _, Direction, EndpointAddress, EndpointAllocError, EndpointError, EndpointIn, EndpointInfo, EndpointOut, + EndpointType, Event, SynchronizationType, Unsupported, UsageType, }; pub mod otg_v1; @@ -497,10 +498,14 @@ impl<'d, const MAX_EP_COUNT: usize> embassy_usb_driver::Driver<'d> for Driver<'d } fn grow_endpoint_in_buffer(&mut self, ep: &mut Self::EndpointIn, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } fn grow_endpoint_out_buffer(&mut self, ep: &mut Self::EndpointOut, new_max_packet_size: u16) { + let _ = new_max_packet_size; + let _ = ep; warn!("Not implemented yet!!!"); } } @@ -889,18 +894,26 @@ impl<'d, const MAX_EP_COUNT: usize> embassy_usb_driver::Bus for Bus<'d, MAX_EP_C } fn endpoint_set_buffersize(&mut self, ep_addr: EndpointAddress, buf_size: u16) { + let _ = ep_addr; + let _ = buf_size; warn!("Not implemented yet!!!"); } fn endpoint_set_sync_type(&mut self, ep_addr: EndpointAddress, synchronization_type: SynchronizationType) { + let _ = ep_addr; + let _ = synchronization_type; warn!("Not implemented yet!!!"); } fn endpoint_set_usage_type(&mut self, ep_addr: EndpointAddress, usage_type: UsageType) { + let _ = ep_addr; + let _ = usage_type; warn!("Not implemented yet!!!"); } fn endpoint_set_type(&mut self, ep_addr: EndpointAddress, ep_type: EndpointType) { + let _ = ep_addr; + let _ = ep_type; warn!("Not implemented yet!!!"); }