Skip to content

Commit

Permalink
Merge pull request #22 from martinroger/betterMessageTiming
Browse files Browse the repository at this point in the history
Better message timing
  • Loading branch information
martinroger authored Jan 7, 2025
2 parents cf1caa3 + c223ef2 commit 05efd77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/esPod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ void esPod::refresh()
if (tempChecksum == _rxBuf[_rxLen]) //Checksum checks out
{
processPacket(_rxBuf,_rxLen);
break; //This should process messages one by one
}
}
}
Expand All @@ -1277,10 +1278,14 @@ void esPod::refresh()
//pass to the previous received byte
_prevRxByte = incomingByte;
}
else //If the espod is disabled
{
_targetSerial.read();
}
}

//Reset if no message received in the last 120s
if((millis()-lastConnected > 120000) && !disabled)
if((millis()-lastConnected > 30000) && !disabled)
{
ESP_LOGW(IPOD_TAG,"Serial comms timed out: %lu ms",millis()-lastConnected);
resetState();
Expand Down

0 comments on commit 05efd77

Please sign in to comment.