mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Fix missed ep0-data-out transaction
The ep0-out buffer must not be marked as available unless required. Otherwise, the controller will acknowledge the data-out packet but won't reflect that in its status registers. This patch forces the controller to nack the data-out phase until we have processed the setup packet.
This commit is contained in:
parent
067f1396d9
commit
fa7c9275b4
|
@ -352,8 +352,12 @@ impl Inner {
|
||||||
w.full_0().clear_bit();
|
w.full_0().clear_bit();
|
||||||
w.pid_0().bit(!r.pid_0().bit())
|
w.pid_0().bit(!r.pid_0().bit())
|
||||||
});
|
});
|
||||||
|
if index != 0 || len == ep.max_packet_size.into() {
|
||||||
|
// only mark as available on the control endpoint if and only if the packet was
|
||||||
|
// max_packet_size
|
||||||
cortex_m::asm::delay(12);
|
cortex_m::asm::delay(12);
|
||||||
buf_control.modify(|_, w| w.available_0().set_bit());
|
buf_control.modify(|_, w| w.available_0().set_bit());
|
||||||
|
}
|
||||||
Ok(len)
|
Ok(len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue