You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/06/25 08:26:32 UTC

[mynewt-nimble] 02/02: drivers/nrf52: do not set IRQ prio for RIOT

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 1dfda9db14ed72b9050ca607450d0c8fc9f927e0
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Jun 13 15:40:36 2019 +0200

    drivers/nrf52: do not set IRQ prio for RIOT
    
    RIOT does not allow for nested interrupts and initializes all IRQs
    to the same priority during system initialization. Assigning
    different priorities in the driver leads to system crashes.
---
 nimble/drivers/nrf52/src/ble_hw.c  | 2 ++
 nimble/drivers/nrf52/src/ble_phy.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/nimble/drivers/nrf52/src/ble_hw.c b/nimble/drivers/nrf52/src/ble_hw.c
index 07297a2..f084ff1 100644
--- a/nimble/drivers/nrf52/src/ble_hw.c
+++ b/nimble/drivers/nrf52/src/ble_hw.c
@@ -319,7 +319,9 @@ ble_hw_rng_init(ble_rng_isr_cb_t cb, int bias)
 
     /* If we were passed a function pointer we need to enable the interrupt */
     if (cb != NULL) {
+#ifndef RIOT_VERSION
         NVIC_SetPriority(RNG_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
+#endif
 #if MYNEWT
         NVIC_SetVector(RNG_IRQn, (uint32_t)ble_rng_isr);
 #else
diff --git a/nimble/drivers/nrf52/src/ble_phy.c b/nimble/drivers/nrf52/src/ble_phy.c
index b36e502..e8e6978 100644
--- a/nimble/drivers/nrf52/src/ble_phy.c
+++ b/nimble/drivers/nrf52/src/ble_phy.c
@@ -1440,7 +1440,9 @@ ble_phy_init(void)
     NRF_PPI->CH[5].TEP = (uint32_t)&(NRF_RADIO->TASKS_DISABLE);
 
     /* Set isr in vector table and enable interrupt */
+#ifndef RIOT_VERSION
     NVIC_SetPriority(RADIO_IRQn, 0);
+#endif
 #if MYNEWT
     NVIC_SetVector(RADIO_IRQn, (uint32_t)ble_phy_isr);
 #else