mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-11-09 22:10:34 +00:00
drivers/nrf51: generalize to other OSes than mynewt
This commit is contained in:
committed by
Andrzej Kaczmarek
parent
8b45120e11
commit
976bb8f84b
@@ -27,7 +27,13 @@
|
||||
#include "nimble/nimble_opt.h"
|
||||
#include "nrfx.h"
|
||||
#include "controller/ble_hw.h"
|
||||
#if MYNEWT
|
||||
#include "mcu/cmsis_nvic.h"
|
||||
#else
|
||||
#include "core_cm0.h"
|
||||
#include <nimble/nimble_npl_os.h>
|
||||
#endif
|
||||
#include "os/os_trace_api.h"
|
||||
|
||||
/* Total number of resolving list elements */
|
||||
#define BLE_HW_RESOLV_LIST_SIZE (16)
|
||||
@@ -314,7 +320,11 @@ 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) {
|
||||
NVIC_SetPriority(RNG_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
|
||||
#if MYNEWT
|
||||
NVIC_SetVector(RNG_IRQn, (uint32_t)ble_rng_isr);
|
||||
#else
|
||||
ble_npl_hw_set_isr(RNG_IRQn, ble_rng_isr);
|
||||
#endif
|
||||
NVIC_EnableIRQ(RNG_IRQn);
|
||||
g_ble_rng_isr_cb = cb;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "syscfg/syscfg.h"
|
||||
#include "os/os.h"
|
||||
#include "ble/xcvr.h"
|
||||
#include "mcu/cmsis_nvic.h"
|
||||
#include "nimble/ble.h"
|
||||
#include "nimble/nimble_opt.h"
|
||||
#include "controller/ble_phy.h"
|
||||
@@ -33,6 +32,9 @@
|
||||
|
||||
#if MYNEWT
|
||||
#include "mcu/nrf51_clock.h"
|
||||
#include "mcu/cmsis_nvic.h"
|
||||
#else
|
||||
#include "core_cm0.h"
|
||||
#endif
|
||||
|
||||
/* XXX: 4) Make sure RF is higher priority interrupt than schedule */
|
||||
@@ -907,7 +909,11 @@ ble_phy_init(void)
|
||||
|
||||
/* Set isr in vector table and enable interrupt */
|
||||
NVIC_SetPriority(RADIO_IRQn, 0);
|
||||
#if MYNEWT
|
||||
NVIC_SetVector(RADIO_IRQn, (uint32_t)ble_phy_isr);
|
||||
#else
|
||||
ble_npl_hw_set_isr(RADIO_IRQn, ble_phy_isr);
|
||||
#endif
|
||||
NVIC_EnableIRQ(RADIO_IRQn);
|
||||
|
||||
/* Register phy statistics */
|
||||
|
||||
Reference in New Issue
Block a user