mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
dcd_da146xx: Fix EPIN stall notification handling
Normal TX handler for IN non-0 endpoints is called during outgoing transfer or just after it was finished. It may need to fill TX fifo with same data if TX_DONE is present but ACK_STAT is not. It may need to fill more data when called during transfer. But it may also be called when STALL was sent. In this case TX_DONE is set ACK_STAT is not, just like for packets that were sent but no ACK was received. Code was trying to send something again. There was nothing to send so empty ZLP was scheduled for stalled endpoint. This ZLP was later send to host where valid response was required. This change checks if notification was for STALL endpoint and does not try to fill TX FIFO in that case.
This commit is contained in:
parent
4d0cf6135a
commit
49aa0b72a8
@ -632,6 +632,13 @@ static void handle_epx_tx_ev(xfer_ctl_t *xfer)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (regs->epc_in & USB_USB_EPC1_REG_USB_STALL_Msk)
|
||||
{
|
||||
// TX_DONE also indicates that STALL packet was just sent, there is
|
||||
// no point to put anything into transmit FIFO. It could result in
|
||||
// empty packet being scheduled.
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (txs & USB_USB_TXS1_REG_USB_TX_URUN_Msk)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user