hack: disallow stalling in rp2040
This commit is contained in:
parent
da9ce32909
commit
0b86bf84c1
1 changed files with 3 additions and 30 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue