my new watchdog related to the the send tx bug was not quite complete

https://github.com/meshtastic/Meshtastic-esp32/issues/53
1.2-legacy
geeksville 2020-03-25 11:45:18 -07:00
rodzic 7210c1ae5e
commit 65128a04c9
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -145,11 +145,16 @@ ErrorCode MeshRadio::send(MeshPacket *p)
void MeshRadio::loop() void MeshRadio::loop()
{ {
// It should never take us more than 30 secs to send a packet, if it does, we have a bug // It should never take us more than 30 secs to send a packet, if it does, we have a bug, FIXME, move most of this
// into CustomRF95
uint32_t now = millis(); uint32_t now = millis();
if (lastTxStart != 0 && (now - lastTxStart) > TX_WATCHDOG_TIMEOUT && rf95.mode() == RHGenericDriver::RHModeTx) { if (lastTxStart != 0 && (now - lastTxStart) > TX_WATCHDOG_TIMEOUT && rf95.mode() == RHGenericDriver::RHModeTx) {
DEBUG_MSG("ERROR! Bug! Tx packet took too long to send, forcing radio into rx mode"); DEBUG_MSG("ERROR! Bug! Tx packet took too long to send, forcing radio into rx mode");
rf95.setModeRx(); rf95.setModeRx();
if (rf95.sendingPacket) { // There was probably a packet we were trying to send, free it
rf95.pool.release(rf95.sendingPacket);
rf95.sendingPacket = NULL;
}
recordCriticalError(ErrTxWatchdog); recordCriticalError(ErrTxWatchdog);
lastTxStart = 0; // Stop checking for now, because we just warned the developer lastTxStart = 0; // Stop checking for now, because we just warned the developer
} }