Skip to content

Commit ed0d587

Browse files
authored
Merge pull request #2782 from rgrr/fix-dcd_nrf5x-wrong-order
dcd_nrf5x: fix race condition
2 parents 669f341 + 1d2c9f9 commit ed0d587

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/portable/nordic/nrf5x/dcd_nrf5x.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t to
441441
bool const control_status = (epnum == 0 && total_bytes == 0 && dir != tu_edpt_dir(NRF_USBD->BMREQUESTTYPE));
442442

443443
if (control_status) {
444-
// Status Phase also requires EasyDMA has to be available as well !!!!
445-
edpt_dma_start(&NRF_USBD->TASKS_EP0STATUS);
446-
447444
// The nRF doesn't interrupt on status transmit so we queue up a success response.
448445
dcd_event_xfer_complete(0, ep_addr, 0, XFER_RESULT_SUCCESS, is_in_isr());
446+
447+
// Status Phase also requires EasyDMA has to be available as well !!!!
448+
edpt_dma_start(&NRF_USBD->TASKS_EP0STATUS);
449449
} else if (dir == TUSB_DIR_OUT) {
450450
xfer->started = true;
451451
if (epnum == 0) {

0 commit comments

Comments
 (0)