summaryrefslogtreecommitdiff
path: root/ports/nrf/drivers/bluetooth
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-07-16 19:36:40 -0400
committerDan Halbert <halbert@halwitz.org>2018-07-16 19:36:40 -0400
commit2809b4f9dd08dd1e83e87f1f4088ba22f3f66cd2 (patch)
treee87027c60d5de0811f6213d087c677bc59295bd0 /ports/nrf/drivers/bluetooth
parente2e01efa84d2ed46d004edf48076e4701accc176 (diff)
parent617351aebc59e27a5f9a8a3b38032637a49f5432 (diff)
Merge branch 'master' into micropython-25ae98f-merge
Diffstat (limited to 'ports/nrf/drivers/bluetooth')
-rw-r--r--ports/nrf/drivers/bluetooth/ble_drv.c9
-rw-r--r--ports/nrf/drivers/bluetooth/ble_uart.c5
2 files changed, 10 insertions, 4 deletions
diff --git a/ports/nrf/drivers/bluetooth/ble_drv.c b/ports/nrf/drivers/bluetooth/ble_drv.c
index 8200dec2e..28d728d71 100644
--- a/ports/nrf/drivers/bluetooth/ble_drv.c
+++ b/ports/nrf/drivers/bluetooth/ble_drv.c
@@ -30,12 +30,15 @@
#include <string.h>
#include <stdbool.h>
+#if (BLUETOOTH_SD == 132)
#define NRF52 // Needed for SD132 v2
+#endif
#include "py/runtime.h"
#include "ble_drv.h"
#include "mpconfigport.h"
#include "nrf_sdm.h"
+#include "nrfx_power.h"
#include "ble_gap.h"
#include "ble.h" // sd_ble_uuid_encode
@@ -142,6 +145,12 @@ uint32_t ble_drv_stack_enable(void) {
#endif
};
#endif
+
+#if (BLUETOOTH_SD == 140)
+ // The SD takes over the POWER IRQ and will fail if the IRQ is already in use
+ nrfx_power_uninit();
+#endif
+
uint32_t err_code = sd_softdevice_enable(&clock_config,
softdevice_assert_handler);
diff --git a/ports/nrf/drivers/bluetooth/ble_uart.c b/ports/nrf/drivers/bluetooth/ble_uart.c
index 5f303a0af..52c042f7b 100644
--- a/ports/nrf/drivers/bluetooth/ble_uart.c
+++ b/ports/nrf/drivers/bluetooth/ble_uart.c
@@ -29,14 +29,11 @@
#include <string.h>
#include "ble_uart.h"
#include "ringbuffer.h"
+#include "py/mphal.h"
#include "lib/utils/interrupt_char.h"
#if MICROPY_PY_BLE_NUS
-#if BLUETOOTH_WEBBLUETOOTH_REPL
-#include "hal_time.h"
-#endif // BLUETOOTH_WEBBLUETOOTH_REPL
-
static ubluepy_uuid_obj_t uuid_obj_service = {
.base.type = &ubluepy_uuid_type,
.type = UBLUEPY_UUID_128_BIT,