From 44e0f8638263d825c2af26e317dd16db416e73a4 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Wed, 11 Dec 2019 10:36:49 +0100 Subject: [PATCH] make race condition less likely to happen. real solution should use a mutex --- libraries/SondeLib/Sonde.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/SondeLib/Sonde.cpp b/libraries/SondeLib/Sonde.cpp index 576757d..c28a9b3 100644 --- a/libraries/SondeLib/Sonde.cpp +++ b/libraries/SondeLib/Sonde.cpp @@ -427,6 +427,7 @@ void Sonde::receive() { } } else { // RX not ok if(res==RX_ERROR) flashLed(100); + Serial.printf("RX result %d, laststate was %d\n", res, si->lastState); if(si->lastState != 0) { si->norxStart = millis(); si->lastState = 0; @@ -471,8 +472,8 @@ uint16_t Sonde::waitRXcomplete() { rxloop: while( rxtask.receiveResult==0xFFFF && millis()-t0 < 2000) { delay(50); } if( rxtask.receiveResult == RX_UPDATERSSI ) { - Serial.print("RSSI update: "); rxtask.receiveResult = 0xFFFF; + Serial.print("RSSI update: "); disp.updateDisplayRSSI(); goto rxloop; }