From bd0747473242d5d7c58ebc67ab0aa5098db56547 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 8 Nov 2018 22:53:27 +0700 Subject: [PATCH] clean up --- cores/nRF5/usb/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cores/nRF5/usb/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c b/cores/nRF5/usb/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c index 174d6cf9..a3715907 100644 --- a/cores/nRF5/usb/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c +++ b/cores/nRF5/usb/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c @@ -65,6 +65,8 @@ enum { /*------------------------------------------------------------------*/ /* MACRO TYPEDEF CONSTANT ENUM *------------------------------------------------------------------*/ +// Priorities 0, 1, 4 (nRF52) are reserved for SoftDevice +// 2 is highest for application #define USB_NVIC_PRIO 2 void tusb_hal_nrf_power_event(uint32_t event); @@ -261,7 +263,7 @@ void tusb_hal_nrf_power_event (uint32_t event) NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk | USBD_INTEN_USBEVENT_Msk | USBD_INTEN_EPDATA_Msk | USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk; - // Enable interrupt, Priorities 0,1,4,5 (nRF52) are reserved for SoftDevice + // Enable interrupt NVIC_SetPriority(USBD_IRQn, USB_NVIC_PRIO); NVIC_ClearPendingIRQ(USBD_IRQn); NVIC_EnableIRQ(USBD_IRQn);