Skip to content

Commit

Permalink
Merge pull request #1685 from battlesnake/st_synopsys_sof
Browse files Browse the repository at this point in the history
Add SOF support for ST Synopsys port
  • Loading branch information
hathach committed Apr 16, 2024
2 parents f3781a4 + e1c3b5a commit 178c414
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/portable/synopsys/dwc2/dcd_dwc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,16 +1136,14 @@ void dcd_int_handler(uint8_t rhport) {

if(int_status & GINTSTS_SOF) {
dwc2->gintsts = GINTSTS_SOF;
const uint32_t frame = (dwc2->dsts & DSTS_FNSOF) >> DSTS_FNSOF_Pos;

if (_sof_en) {
uint32_t frame = (dwc2->dsts & (DSTS_FNSOF)) >> 8;
dcd_event_sof(rhport, frame, true);
} else {
// Disable SOF interrupt if SOF was not explicitly enabled. SOF was used for remote wakeup detection
// Disable SOF interrupt if SOF was not explicitly enabled since SOF was used for remote wakeup detection
if (!_sof_en) {
dwc2->gintmsk &= ~GINTMSK_SOFM;
}

dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
dcd_event_sof(rhport, frame, true);
}

// RxFIFO non-empty interrupt handling.
Expand Down

0 comments on commit 178c414

Please sign in to comment.