Skip to content

Commit a258a34

Browse files
author
Kyle Granat
committed
Bug Fix timeout
Fixespossible endless loop
1 parent b14feb1 commit a258a34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RFIDuino/RFIDuino.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ bool RFIDuino::decodeTag(unsigned char *buf)
4949
while(0==digitalRead(DEMOD_OUT)) //watch for DEMOD_OUT to go low
5050
{
5151

52-
if(timeCount==TIMEOUT) //if we pass TIMEOUT milliseconds, break out of the loop
52+
if(timeCount>=TIMEOUT) //if we pass TIMEOUT milliseconds, break out of the loop
5353
break;
5454
else
5555
timeCount++;
5656
}
5757

58-
if (timeCount==600)
58+
if (timeCount>=600)
5959
return false;
6060
else
6161
timeCount=0;

0 commit comments

Comments
 (0)