WIP - I think some pins are wrong, waiting for new schematic

This commit is contained in:
geeksville
2020-09-24 16:36:07 -07:00
parent 86d6f88787
commit a79aff4778
3 changed files with 33 additions and 28 deletions

View File

@@ -49,14 +49,19 @@ void getMacAddr(uint8_t *dmac)
NRF52Bluetooth *nrf52Bluetooth;
static bool bleOn = false;
static const bool enableBle = false; // Set to false for easier debugging
void setBluetoothEnable(bool on)
{
if (on != bleOn) {
if (on) {
if (!nrf52Bluetooth) {
// DEBUG_MSG("DISABLING NRF52 BLUETOOTH WHILE DEBUGGING\n");
nrf52Bluetooth = new NRF52Bluetooth();
nrf52Bluetooth->setup();
if (!enableBle)
DEBUG_MSG("DISABLING NRF52 BLUETOOTH WHILE DEBUGGING\n");
else {
nrf52Bluetooth = new NRF52Bluetooth();
nrf52Bluetooth->setup();
}
}
} else {
DEBUG_MSG("FIXME: implement BLE disable\n");
@@ -88,6 +93,11 @@ void nrf52Setup()
// This is the recommended setting for Monitor Mode Debugging
NVIC_SetPriority(DebugMonitor_IRQn, 6UL);
#ifdef PIN_PWR_ON
digitalWrite(PIN_PWR_ON, HIGH); // If we need to assert a pin to power external peripherals
pinMode(PIN_PWR_ON, OUTPUT);
#endif
// Not yet on board
// pmu.init();