Skip to content

Commit

Permalink
Fix endless loop in 1-Wire during ID search (#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
up-streamer authored and josesimoes committed Nov 12, 2019
1 parent b5e3989 commit b774ca6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ bool oneWireFindNext (bool doReset, bool alarmOnly)
}
while (romByteIndex < 8); // loop until we have all ROM bytes

if (romBitIndex < (65 || lastcrc8))
if ((romBitIndex < 65) || (lastcrc8 != 0))
{
// search was unsuccessful reset the last discrepancy
LastDiscrepancy = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ bool oneWireFindNext (bool doReset, bool alarmOnly)
}
while (romByteIndex < 8); // loop until we have all ROM bytes

if (romBitIndex < (65 || lastcrc8))
if ((romBitIndex < 65) || (lastcrc8 != 0))
{
// search was unsuccessful reset the last discrepancy
LastDiscrepancy = 0;
Expand Down

0 comments on commit b774ca6

Please sign in to comment.