diff options
| author | Andrew Leech <[email protected]> | 2024-05-16 14:12:22 +1000 |
|---|---|---|
| committer | Andrew Leech <[email protected]> | 2024-05-27 20:35:35 +1000 |
| commit | e229270a1c3d542cdf9924313f585dd43c607de8 (patch) | |
| tree | d26877804bdcbb9fb2c869a1c7eff670ca52f1b5 /src | |
| parent | a2e5ea1882f130ee22eedbb68296b4b5ce561f77 (diff) | |
microchip samd: Add support for dcd_sof_enable().
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/microchip/samd/dcd_samd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/portable/microchip/samd/dcd_samd.c b/src/portable/microchip/samd/dcd_samd.c index 976d3dfd0..005b63faf 100644 --- a/src/portable/microchip/samd/dcd_samd.c +++ b/src/portable/microchip/samd/dcd_samd.c @@ -183,9 +183,12 @@ void dcd_connect(uint8_t rhport) void dcd_sof_enable(uint8_t rhport, bool en) { (void) rhport; - (void) en; - // TODO implement later + if (en) { + USB->DEVICE.INTENSET.bit.SOF = 1; + } else { + USB->DEVICE.INTENCLR.bit.SOF = 1; + } } /*------------------------------------------------------------------*/ @@ -374,7 +377,9 @@ void dcd_int_handler (uint8_t rhport) if ( int_status & USB_DEVICE_INTFLAG_SOF ) { USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_SOF; - dcd_event_bus_signal(0, DCD_EVENT_SOF, true); + const uint32_t frame = USB->DEVICE.FNUM.bit.FNUM; + dcd_event_sof(0, frame, true); + //dcd_event_bus_signal(0, DCD_EVENT_SOF, true); } // SAMD doesn't distinguish between Suspend and Disconnect state. |
