Improve pingpair timing. Should lead to less timeouts.

This commit is contained in:
maniacbug 2011-08-01 21:05:54 -07:00
parent c9d64fd088
commit 7b401d7281
1 changed files with 5 additions and 1 deletions

View File

@ -159,7 +159,7 @@ void loop(void)
unsigned long started_waiting_at = millis();
bool timeout = false;
while ( ! radio.available() && ! timeout )
if (millis() - started_waiting_at > 250 )
if (millis() - started_waiting_at > 200 )
timeout = true;
// Describe the results
@ -200,6 +200,10 @@ void loop(void)
// Spew it
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