mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 14:53:03 +00:00
Fix for #3493 - panic! in embassy-usb-synopsys-otg on second serial connection
This commit is contained in:
parent
fcbbef01cd
commit
4b1b7a3508
@ -43,7 +43,16 @@ pub unsafe fn on_interrupt<const MAX_EP_COUNT: usize>(
|
|||||||
let ep_num = status.epnum() as usize;
|
let ep_num = status.epnum() as usize;
|
||||||
let len = status.bcnt() as usize;
|
let len = status.bcnt() as usize;
|
||||||
|
|
||||||
assert!(ep_num < ep_count);
|
if ep_num >= ep_count {
|
||||||
|
// Removed `assert!(ep_num < ep_count);` as this fails for second serial connection UNLESS
|
||||||
|
// defmt-trace level debugging is enabled embassy-stm32 (note that the defmt feature
|
||||||
|
// doesnt work in embassy-usb-synopsys-otg as defmt::assert! generates multiple errors)
|
||||||
|
//
|
||||||
|
// I'm guessing this may be some sort of timing issue so instead of panic-ing skip
|
||||||
|
// invalid packet :‑(
|
||||||
|
error!("Skipping Invalid Packet (ep_num >= ep_count): ep_num: {} ep_count: {}", ep_num, ep_count);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
match status.pktstsd() {
|
match status.pktstsd() {
|
||||||
vals::Pktstsd::SETUP_DATA_RX => {
|
vals::Pktstsd::SETUP_DATA_RX => {
|
||||||
|
Loading…
Reference in New Issue
Block a user