diff options
| author | Jan Dümpelmann <[email protected]> | 2020-05-15 18:21:44 +0200 |
|---|---|---|
| committer | Jan Dümpelmann <[email protected]> | 2020-05-15 18:21:44 +0200 |
| commit | 28696de39011f01ba34e49c2a53efa8e6f43c8ea (patch) | |
| tree | 1356da3765a3a02152e98e82d957fc4fd2f63b22 /src/portable | |
| parent | 3401e0f6ff419888282e8ce75768bd47b630b674 (diff) | |
Interrupt time improvements
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/st/synopsys/dcd_synopsys.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c index 149919d54..73e6ca827 100644 --- a/src/portable/st/synopsys/dcd_synopsys.c +++ b/src/portable/st/synopsys/dcd_synopsys.c @@ -708,14 +708,19 @@ void dcd_int_handler(uint8_t rhport) { } #endif - // Use while loop to handle more than one fifo data entry - // within a single interrupt call - while(USB_OTG_FS->GINTSTS & USB_OTG_GINTSTS_RXFLVL) { + // RxFIFO non-empty interrupt handling. + if(int_status & USB_OTG_GINTSTS_RXFLVL) { // RXFLVL bit is read-only // Mask out RXFLVL while reading data from FIFO USB_OTG_FS->GINTMSK &= ~USB_OTG_GINTMSK_RXFLVLM; - handle_rxflvl_ints(out_ep); + + // Loop until all available packets were handled + do { + handle_rxflvl_ints(out_ep); + int_status = USB_OTG_FS->GINTSTS; + } while(int_status & USB_OTG_GINTSTS_RXFLVL); + USB_OTG_FS->GINTMSK |= USB_OTG_GINTMSK_RXFLVLM; } |
