Skip to content

Commit

Permalink
Merge pull request #65 from brunojoyal/master
Browse files Browse the repository at this point in the history
Fix phantom stale packets
  • Loading branch information
PowerBroker2 authored Apr 21, 2021
2 parents 5bdb1d4 + 0be2112 commit 6e67323
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ uint8_t Packet::parse(const uint8_t& recChar, const bool& valid)
if (recChar == START_BYTE)
{
state = find_id_byte;
packetStart = millis();
packetStart = millis(); //start the timer
}

break;
Expand Down Expand Up @@ -242,7 +242,7 @@ uint8_t Packet::parse(const uint8_t& recChar, const bool& valid)
debugPort->println(idByte);
}
}

packetStart = 0; // reset the timer
return bytesToRec;
}

Expand Down Expand Up @@ -443,5 +443,5 @@ void Packet::reset()

bytesRead = 0;
status = CONTINUE;
packetStart = millis();
packetStart = 0;
}

0 comments on commit 6e67323

Please sign in to comment.