- Added protection against zero division.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@181 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2016-11-15 08:39:47 +00:00
parent 1d3fe6e745
commit d677bf4bfd
2 changed files with 4 additions and 1 deletions

View File

@ -250,7 +250,10 @@ begin
// re-confgure the reception timeout now that the total packet length is known.
// timeout = (MULTIPLIER) * number_of_bytes + CONSTANT
sciDriver.Timeouts.ReadTotalConstant := 0;
sciDriver.Timeouts.ReadTotalMultiplier := timeOutms div resLen;
if timeOutms > 0 then
sciDriver.Timeouts.ReadTotalMultiplier := timeOutms div resLen
else
sciDriver.Timeouts.ReadTotalMultiplier := timeOutms;
// attempt to receive the bytes of the response packet one by one
while (rxCnt < resLen) and (GetTickCount < dwEnd) do

Binary file not shown.