Merge pull request #61 from nicolasimeoni/patch-1

Update _loraModem.ino
master
Maarten Westenberg 2019-03-27 12:38:21 +01:00 zatwierdzone przez GitHub
commit 2a6eb1b51c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -644,10 +644,12 @@ void loraWait(const uint32_t timestamp)
Serial.print(LoraDown.sfTx);
}
#endif
break; // to avoid compiler error when DUSB==0
}
tmst = tmst + txDelay + adjust; // tmst based on txDelay and spreading factor
uint32_t waitTime = tmst - micros();
if (waitTime<0) {
// if (waitTime<0) { //uint32_t is never negative! If micros() is > tmst, waitTime assume a very big value and the app hangs
if (micros()>tmst) { // test if the tmst is in the past to avoid hangs
Serial.println(F("loraWait:: Error wait time < 0"));
return;
}