Skip to content

Commit c7fce32

Browse files
authored
Merge pull request hathach#1535 from robert-hh/samd_xfer_lockup
samd: Fix a lock-up situation at high traffic.
2 parents 3ead682 + bc4da20 commit c7fce32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/portable/microchip/samd/dcd_samd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
286286
{
287287
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = total_bytes;
288288
bank->PCKSIZE.bit.BYTE_COUNT = 0;
289-
ep->EPSTATUSCLR.reg |= USB_DEVICE_EPSTATUSCLR_BK0RDY;
290-
ep->EPINTFLAG.reg |= USB_DEVICE_EPINTFLAG_TRFAIL0;
289+
ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK0RDY;
290+
ep->EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRFAIL0;
291291
} else
292292
{
293293
bank->PCKSIZE.bit.MULTI_PACKET_SIZE = 0;
294294
bank->PCKSIZE.bit.BYTE_COUNT = total_bytes;
295-
ep->EPSTATUSSET.reg |= USB_DEVICE_EPSTATUSSET_BK1RDY;
296-
ep->EPINTFLAG.reg |= USB_DEVICE_EPINTFLAG_TRFAIL1;
295+
ep->EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK1RDY;
296+
ep->EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRFAIL1;
297297
}
298298

299299
return true;

0 commit comments

Comments
 (0)