Skip to content

Commit 2f877bd

Browse files
authored
Merge pull request adafruit#1022 from arturo182/nrf_usb_ble
nrf: Fix BLE on nRF52840 after adding the USB functionality
2 parents 75f48a5 + 9729fc3 commit 2f877bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ports/nrf/drivers/bluetooth/ble_drv.c

+9
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@
3030
#include <string.h>
3131
#include <stdbool.h>
3232

33+
#if (BLUETOOTH_SD == 132)
3334
#define NRF52 // Needed for SD132 v2
35+
#endif
3436

3537
#include "py/runtime.h"
3638
#include "ble_drv.h"
3739
#include "mpconfigport.h"
3840
#include "nrf_sdm.h"
41+
#include "nrfx_power.h"
3942
#include "ble_gap.h"
4043
#include "ble.h" // sd_ble_uuid_encode
4144

@@ -142,6 +145,12 @@ uint32_t ble_drv_stack_enable(void) {
142145
#endif
143146
};
144147
#endif
148+
149+
#if (BLUETOOTH_SD == 140)
150+
// The SD takes over the POWER IRQ and will fail if the IRQ is already in use
151+
nrfx_power_uninit();
152+
#endif
153+
145154
uint32_t err_code = sd_softdevice_enable(&clock_config,
146155
softdevice_assert_handler);
147156

0 commit comments

Comments
 (0)