diff --git a/platformio.ini b/platformio.ini index 042d4ed2e..d06a02f5e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = tbeam ; Note: the github actions CI test build can't yet build NRF52 targets +default_envs = nrf52dk ; Note: the github actions CI test build can't yet build NRF52 targets [common] ; common is not currently used diff --git a/src/nrf52/NRF52Bluetooth.cpp b/src/nrf52/NRF52Bluetooth.cpp index 9cf6e3708..22ee69dc2 100644 --- a/src/nrf52/NRF52Bluetooth.cpp +++ b/src/nrf52/NRF52Bluetooth.cpp @@ -148,6 +148,9 @@ void setupHRM(void) bslc.write8(2); // Set the characteristic to 'Wrist' (2) } +// FIXME, turn off soft device access for debugging +static bool isSoftDeviceAllowed = false; + void NRF52Bluetooth::setup() { // Initialise the Bluefruit module @@ -179,11 +182,14 @@ void NRF52Bluetooth::setup() DEBUG_MSG("Configuring the Heart Rate Monitor Service\n"); setupHRM(); - // Setup the advertising packet(s) - DEBUG_MSG("Setting up the advertising payload(s)\n"); - startAdv(); + // Supposedly debugging works with soft device if you disable advertising + if (isSoftDeviceAllowed) { + // Setup the advertising packet(s) + DEBUG_MSG("Setting up the advertising payload(s)\n"); + startAdv(); - DEBUG_MSG("Advertising\n"); + DEBUG_MSG("Advertising\n"); + } } /* diff --git a/src/nrf52/main-nrf52.cpp b/src/nrf52/main-nrf52.cpp index 559a28cf4..c7e5a38c8 100644 --- a/src/nrf52/main-nrf52.cpp +++ b/src/nrf52/main-nrf52.cpp @@ -43,15 +43,12 @@ void getMacAddr(uint8_t *dmac) NRF52Bluetooth *nrf52Bluetooth; -// FIXME, turn off soft device access for debugging -static bool isSoftDeviceAllowed = false; - static bool bleOn = false; void setBluetoothEnable(bool on) { if (on != bleOn) { if (on) { - if (!nrf52Bluetooth && isSoftDeviceAllowed) { + if (!nrf52Bluetooth) { nrf52Bluetooth = new NRF52Bluetooth(); nrf52Bluetooth->setup(); }