Improve pingpair timing. Should lead to less timeouts.
This commit is contained in:
@@ -159,7 +159,7 @@ void loop(void)
|
|||||||
unsigned long started_waiting_at = millis();
|
unsigned long started_waiting_at = millis();
|
||||||
bool timeout = false;
|
bool timeout = false;
|
||||||
while ( ! radio.available() && ! timeout )
|
while ( ! radio.available() && ! timeout )
|
||||||
if (millis() - started_waiting_at > 250 )
|
if (millis() - started_waiting_at > 200 )
|
||||||
timeout = true;
|
timeout = true;
|
||||||
|
|
||||||
// Describe the results
|
// Describe the results
|
||||||
@@ -200,6 +200,10 @@ void loop(void)
|
|||||||
|
|
||||||
// Spew it
|
// Spew it
|
||||||
printf("Got payload %lu...",got_time);
|
printf("Got payload %lu...",got_time);
|
||||||
|
|
||||||
|
// Delay just a little bit to let the other unit
|
||||||
|
// make the transition to receiver
|
||||||
|
delay(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
// First, stop listening so we can talk
|
// First, stop listening so we can talk
|
||||||
|
|||||||
Reference in New Issue
Block a user