Merge pull request #3088 from HiFiPhile/intv

Fix 1st nak retry one frame shorter.
This commit is contained in:
Ha Thach 2025-04-21 18:31:43 +07:00 committed by GitHub
commit 56ed51c8fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -748,7 +748,11 @@ static void channel_xfer_in_retry(dwc2_regs_t* dwc2, uint8_t ch_id, uint32_t hci
const dwc2_channel_tsize_t hctsiz = {.value = channel->hctsiz};
edpt->next_pid = hctsiz.pid; // save PID
edpt->uframe_countdown = edpt->uframe_interval - ucount;
dwc2->gintmsk |= GINTSTS_SOF;
// enable SOF interrupt if not already enabled
if (!(dwc2->gintmsk & GINTMSK_SOFM)) {
dwc2->gintsts = GINTSTS_SOF;
dwc2->gintmsk |= GINTMSK_SOFM;
}
// already halted, de-allocate channel (called from DMA isr)
channel_dealloc(dwc2, ch_id);
}