Removed 0 max packet size assert for ISO endpoints. Ensured usbd_ep_abort would not be called on ISO endpoints (this currently causes an ASSERT in the Nordic driver

pull/10689/head
George Beckstein 2019-01-19 14:44:35 -05:00 committed by aglass0fmilk
parent 608e326942
commit 0320ebc1d8
1 changed files with 13 additions and 1 deletions

View File

@ -119,6 +119,15 @@ void USBPhyHw::init(USBPhyEvents *events) {
// Store a reference to this instance // Store a reference to this instance
instance = this; instance = this;
/*
* TODO - Configure ISOIN endpoint to respond with ZLP when
* no data is ready to be sent
*
* This is a feature available in the Nordic SDK15.2
* For now we just configure the appropriate register on initialization
*/
NRF_USBD->ISOINCONFIG |= 0x01; // set RESPONSE to 1 (respond with ZLP)
// Enable IRQ // Enable IRQ
NVIC_SetVector(USBD_IRQn, (uint32_t)USBD_IRQHandler); NVIC_SetVector(USBD_IRQn, (uint32_t)USBD_IRQHandler);
//NVIC_SetPriority(USBD_IRQn, 7); //NVIC_SetPriority(USBD_IRQn, 7);
@ -396,7 +405,10 @@ bool USBPhyHw::endpoint_write(usb_ep_t endpoint, uint8_t *data, uint32_t size) {
} }
void USBPhyHw::endpoint_abort(usb_ep_t endpoint) { void USBPhyHw::endpoint_abort(usb_ep_t endpoint) {
nrf_drv_usbd_ep_abort(get_nordic_endpoint(endpoint)); nrf_drv_usbd_ep_t nrf_ep = get_nordic_endpoint(endpoint);
// Don't call abort on ISO endpoints -- this will cause an ASSERT in the Nordic driver
if(nrf_ep != NRF_DRV_USBD_EPOUT8 && nrf_ep != NRF_DRV_USBD_EPIN8)
nrf_drv_usbd_ep_abort(nrf_ep);
} }
void USBPhyHw::process() { void USBPhyHw::process() {