minor update to sof

This commit is contained in:
hathach 2024-04-16 10:57:54 +07:00
parent 50738f2ab4
commit e1c3b5aeab
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52

View File

@ -1136,16 +1136,14 @@ void dcd_int_handler(uint8_t rhport) {
if(int_status & GINTSTS_SOF) { if(int_status & GINTSTS_SOF) {
dwc2->gintsts = GINTSTS_SOF; dwc2->gintsts = GINTSTS_SOF;
const uint32_t frame = (dwc2->dsts & DSTS_FNSOF) >> DSTS_FNSOF_Pos;
if (_sof_en) { // Disable SOF interrupt if SOF was not explicitly enabled since SOF was used for remote wakeup detection
uint32_t frame = (dwc2->dsts & (DSTS_FNSOF)) >> 8; if (!_sof_en) {
dcd_event_sof(rhport, frame, true);
} else {
// Disable SOF interrupt if SOF was not explicitly enabled. SOF was used for remote wakeup detection
dwc2->gintmsk &= ~GINTMSK_SOFM; dwc2->gintmsk &= ~GINTMSK_SOFM;
} }
dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true); dcd_event_sof(rhport, frame, true);
} }
// RxFIFO non-empty interrupt handling. // RxFIFO non-empty interrupt handling.