nrf5x fix an issue with EP0STATUS require Easy DMA

This commit is contained in:
hathach 2018-08-28 15:57:21 +07:00
parent c8b72e397e
commit 583326e535
1 changed files with 4 additions and 7 deletions

View File

@ -86,7 +86,7 @@ typedef struct
{ {
uint8_t* buffer; uint8_t* buffer;
uint16_t total_len; uint16_t total_len;
uint16_t actual_len; volatile uint16_t actual_len;
uint8_t dir; uint8_t dir;
}control; }control;
@ -216,9 +216,9 @@ bool dcd_control_xfer (uint8_t rhport, uint8_t dir, uint8_t * buffer, uint16_t l
xact_control_start(); xact_control_start();
}else }else
{ {
// Status Phase // Status Phase also require Easy DMA has to be free as well !!!!
NRF_USBD->TASKS_EP0STATUS = 1; edpt_dma_start(&NRF_USBD->TASKS_EP0STATUS);
__ISB(); __DSB(); edpt_dma_end();
} }
return true; return true;
@ -418,7 +418,6 @@ void USBD_IRQHandler(void)
if ( int_status & USBD_INTEN_USBRESET_Msk ) if ( int_status & USBD_INTEN_USBRESET_Msk )
{ {
bus_reset(); bus_reset();
dcd_bus_event(0, USBD_BUS_EVENT_RESET); dcd_bus_event(0, USBD_BUS_EVENT_RESET);
} }
@ -559,8 +558,6 @@ void USBD_IRQHandler(void)
{ {
dcd_bus_event(0, USBD_BUS_EVENT_SOF); dcd_bus_event(0, USBD_BUS_EVENT_SOF);
} }
} }
#endif #endif