diff options
| author | Ha Thach <[email protected]> | 2024-04-16 11:11:29 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-16 11:11:29 +0700 |
| commit | 178c4144ad7c625fd7e67eff79fd858f4f2ad7be (patch) | |
| tree | 010e7ad26565f582c03efa4d83d956c5d6b3493a /src | |
| parent | f3781a45d807fe431f567a8e1028ed062c51ec58 (diff) | |
| parent | e1c3b5aeab46de79b08b0655e8ece2c37a0f1a92 (diff) | |
Merge pull request #1685 from battlesnake/st_synopsys_sof
Add SOF support for ST Synopsys port
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/synopsys/dwc2/dcd_dwc2.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c index 830a1ccd0..a824226c7 100644 --- a/src/portable/synopsys/dwc2/dcd_dwc2.c +++ b/src/portable/synopsys/dwc2/dcd_dwc2.c @@ -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. |
