summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-04-16 11:23:38 +0700
committerhathach <[email protected]>2024-04-16 11:23:38 +0700
commit37a05e02647a188f562e763ab24cdbd9f48cf434 (patch)
tree6e681c92c0ec60a0c84a253109562993a8fb536e /src
parentc535a4d42be742f235126fa679bf65a6751360cc (diff)
revert nvic changes
Diffstat (limited to 'src')
-rw-r--r--src/portable/nordic/nrf5x/dcd_nrf5x.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/src/portable/nordic/nrf5x/dcd_nrf5x.c b/src/portable/nordic/nrf5x/dcd_nrf5x.c
index f5eea1310..5f2de6446 100644
--- a/src/portable/nordic/nrf5x/dcd_nrf5x.c
+++ b/src/portable/nordic/nrf5x/dcd_nrf5x.c
@@ -258,27 +258,13 @@ void dcd_init (uint8_t rhport)
void dcd_int_enable(uint8_t rhport)
{
(void) rhport;
-#if defined(SOFTDEVICE_PRESENT) && defined(NORDIC_SDK_OLD_API)
- if (sd_nvic_EnableIRQ(USBD_IRQn) != NRF_SUCCESS)
- {
- NVIC_EnableIRQ(USBD_IRQn);
- }
-#else
NVIC_EnableIRQ(USBD_IRQn);
-#endif
}
void dcd_int_disable(uint8_t rhport)
{
(void) rhport;
-#if defined(SOFTDEVICE_PRESENT) && defined(NORDIC_SDK_OLD_API)
- if (sd_nvic_DisableIRQ(USBD_IRQn) != NRF_SUCCESS)
- {
- NVIC_DisableIRQ(USBD_IRQn);
- }
-#else
NVIC_DisableIRQ(USBD_IRQn);
-#endif
}
void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
@@ -1132,27 +1118,14 @@ void tusb_hal_nrf_power_event (uint32_t event)
NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk;
// Enable interrupt, priorities should be set by application
-#if defined(SOFTDEVICE_PRESENT) && defined(NORDIC_SDK_OLD_API)
- if (sd_nvic_ClearPendingIRQ(USBD_IRQn) != NRF_SUCCESS)
- {
- NVIC_ClearPendingIRQ(USBD_IRQn);
- }
-#else
NVIC_ClearPendingIRQ(USBD_IRQn);
-#endif
+
// Don't enable USBD interrupt yet, if dcd_init() did not finish yet
// Interrupt will be enabled by tud_init(), when USB stack is ready
// to handle interrupts.
if (tud_inited())
{
-#if defined(SOFTDEVICE_PRESENT) && defined(NORDIC_SDK_OLD_API)
- if (sd_nvic_EnableIRQ(USBD_IRQn) != NRF_SUCCESS)
- {
- NVIC_EnableIRQ(USBD_IRQn);
- }
-#else
NVIC_EnableIRQ(USBD_IRQn);
-#endif
}
// Wait for HFCLK
@@ -1173,14 +1146,7 @@ void tusb_hal_nrf_power_event (uint32_t event)
__ISB(); __DSB(); // for sync
// Disable Interrupt
-#if defined(SOFTDEVICE_PRESENT) && defined(NORDIC_SDK_OLD_API)
- if (sd_nvic_DisableIRQ(USBD_IRQn) != NRF_SUCCESS)
- {
- NVIC_DisableIRQ(USBD_IRQn);
- }
-#else
NVIC_DisableIRQ(USBD_IRQn);
-#endif
// disable all interrupt
NRF_USBD->INTENCLR = NRF_USBD->INTEN;