Skip to content

Commit fffbe3b

Browse files
committed
Increased serial receive timeout in readNext() to 1 second. Time out was too short (1ms) which caused the sensor address to be incorrectly received from a Raspberry Pi.
1 parent d3e3072 commit fffbe3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/controller/PiLink.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ void PiLink::sendJsonPair(const char * name, uint8_t val) {
598598

599599
int readNext()
600600
{
601-
uint8_t retries = 0;
601+
uint16_t retries = 0;
602602
while (piStream.available()==0) {
603603
wait.microseconds(100);
604604
retries++;
605-
if(retries >= 10){
605+
if(retries >= 10000){
606606
return -1;
607607
}
608608
}

0 commit comments

Comments
 (0)