diff --git a/docs/software/nrf52-TODO.md b/docs/software/nrf52-TODO.md index cdf57fac9..a0743de44 100644 --- a/docs/software/nrf52-TODO.md +++ b/docs/software/nrf52-TODO.md @@ -8,6 +8,7 @@ Minimum items needed to make sure hardware is good. - DONE get old radio driver working on NRF52 - DONE basic test of BLE - DONE get a debug 'serial' console working via the ICE passthrough feature +- add a hard fault handler - switch to RadioLab? test it with current radio. https://github.com/jgromes/RadioLib - use "variants" to get all gpio bindings - plug in correct variants for the real board diff --git a/src/nrf52/main-nrf52.cpp b/src/nrf52/main-nrf52.cpp index 70e733b90..255b80101 100644 --- a/src/nrf52/main-nrf52.cpp +++ b/src/nrf52/main-nrf52.cpp @@ -17,7 +17,7 @@ static inline void debugger_break(void) void __attribute__((noreturn)) __assert_func(const char *file, int line, const char *func, const char *failedexpr) { DEBUG_MSG("assert failed %s: %d, %s, test=%s\n", file, line, func, failedexpr); - debugger_break(); + // debugger_break(); FIXME doesn't work, possibly not for segger while (1) ; // FIXME, reboot! } diff --git a/src/rf95/RadioLibInterface.cpp b/src/rf95/RadioLibInterface.cpp index 9c772fc66..57d64a3c5 100644 --- a/src/rf95/RadioLibInterface.cpp +++ b/src/rf95/RadioLibInterface.cpp @@ -91,6 +91,8 @@ void RadioLibInterface::loop() if (wasPending) { pending = ISR_NONE; // If the flag was set, it is _guaranteed_ the ISR won't be running, because it masked itself + DEBUG_MSG("Handling a LORA interrupt %d!\n", wasPending); + if (wasPending == ISR_TX) handleTransmitInterrupt(); else if (wasPending == ISR_RX) @@ -193,7 +195,7 @@ void RadioLibInterface::startSend(MeshPacket *txp) size_t numbytes = beginSending(txp); int res = iface.startTransmit(radiobuf, numbytes); - assert(res); + assert(res == ERR_NONE); // Must be done AFTER, starting transmit, because startTransmit clears (possibly stale) interrupt pending register bits enableInterrupt(isrTxLevel0); diff --git a/src/rf95/SX1262Interface.cpp b/src/rf95/SX1262Interface.cpp index 7d5bc4f22..88dfae80e 100644 --- a/src/rf95/SX1262Interface.cpp +++ b/src/rf95/SX1262Interface.cpp @@ -27,7 +27,7 @@ bool SX1262Interface::init() int res = lora.begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength, tcxoVoltage, useRegulatorLDO); DEBUG_MSG("LORA init result %d\n", res); - if (res != ERR_NONE) + if (res == ERR_NONE) res = lora.setCRC(SX126X_LORA_CRC_ON); return res == ERR_NONE;