From 683e4d2f866ce9b30bf383e0042525c5307b5f63 Mon Sep 17 00:00:00 2001 From: Naxdy Date: Sat, 12 Oct 2024 16:30:50 +0200 Subject: [PATCH] hack: disallow stalling in rp2040 --- embassy-rp/src/usb.rs | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/embassy-rp/src/usb.rs b/embassy-rp/src/usb.rs index 512271ae4..01f82a0cd 100644 --- a/embassy-rp/src/usb.rs +++ b/embassy-rp/src/usb.rs @@ -413,40 +413,11 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> { } fn endpoint_set_stalled(&mut self, ep_addr: EndpointAddress, stalled: bool) { - let n = ep_addr.index(); - - if n == 0 { - T::regs().ep_stall_arm().modify(|w| { - if ep_addr.is_in() { - w.set_ep0_in(stalled); - } else { - w.set_ep0_out(stalled); - } - }); - } - - let ctrl = if ep_addr.is_in() { - T::dpram().ep_in_buffer_control(n) - } else { - T::dpram().ep_out_buffer_control(n) - }; - - ctrl.modify(|w| w.set_stall(stalled)); - - let wakers = if ep_addr.is_in() { &EP_IN_WAKERS } else { &EP_OUT_WAKERS }; - wakers[n].wake(); + warn!("Call to unsupported function set_stalled!") } fn endpoint_is_stalled(&mut self, ep_addr: EndpointAddress) -> bool { - let n = ep_addr.index(); - - let ctrl = if ep_addr.is_in() { - T::dpram().ep_in_buffer_control(n) - } else { - T::dpram().ep_out_buffer_control(n) - }; - - ctrl.read().stall() + warn!("Call to unsupported function is_stalled!") } fn endpoint_set_enabled(&mut self, ep_addr: EndpointAddress, enabled: bool) {