hack: disallow stalling in rp2040

This commit is contained in:
Naxdy 2024-10-12 16:31:59 +02:00
parent da9ce32909
commit 0b86bf84c1
Signed by: Naxdy
GPG key ID: CC15075846BCE91B

View file

@ -413,40 +413,13 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
} }
fn endpoint_set_stalled(&mut self, ep_addr: EndpointAddress, stalled: bool) { fn endpoint_set_stalled(&mut self, ep_addr: EndpointAddress, stalled: bool) {
let n = ep_addr.index(); warn!("Call to unsupported function set_stalled!")
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();
} }
fn endpoint_is_stalled(&mut self, ep_addr: EndpointAddress) -> bool { fn endpoint_is_stalled(&mut self, ep_addr: EndpointAddress) -> bool {
let n = ep_addr.index(); warn!("Call to unsupported function is_stalled!");
let ctrl = if ep_addr.is_in() { false
T::dpram().ep_in_buffer_control(n)
} else {
T::dpram().ep_out_buffer_control(n)
};
ctrl.read().stall()
} }
fn endpoint_set_enabled(&mut self, ep_addr: EndpointAddress, enabled: bool) { fn endpoint_set_enabled(&mut self, ep_addr: EndpointAddress, enabled: bool) {