increased reciver time tolerance
This commit is contained in:
@ -29,18 +29,18 @@ int8_t W433DataReciver::reciveBit(uint8_t index)
|
||||
{
|
||||
if(
|
||||
timesBuffer[index] < 0 &&
|
||||
isTime(timesBuffer[index+1], SMALL_TIME, true) &&
|
||||
isTime(timesBuffer[index+2], LARGE_TIME, false) &&
|
||||
isTime(timesBuffer[index+3], SMALL_TIME, true)
|
||||
isTime(timesBuffer[index+1], SMALL_TIME, true, SMALL_TIME_TOLERANCE) &&
|
||||
isTime(timesBuffer[index+2], LARGE_TIME, false, LARGE_TIME_TOLERANCE) &&
|
||||
isTime(timesBuffer[index+3], SMALL_TIME, true, SMALL_TIME_TOLERANCE)
|
||||
)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if(
|
||||
timesBuffer[index] < 0 &&
|
||||
isTime(timesBuffer[index+1], LARGE_TIME, true) &&
|
||||
isTime(timesBuffer[index+2], SMALL_TIME, false) &&
|
||||
isTime(timesBuffer[index+3], SMALL_TIME, true)
|
||||
isTime(timesBuffer[index+1], LARGE_TIME, true, LARGE_TIME_TOLERANCE) &&
|
||||
isTime(timesBuffer[index+2], SMALL_TIME, false, SMALL_TIME_TOLERANCE) &&
|
||||
isTime(timesBuffer[index+3], SMALL_TIME, true, SMALL_TIME_TOLERANCE)
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
@ -58,7 +58,7 @@ bool W433DataReciver::isTime(int16_t input, const uint16_t time, const bool stat
|
||||
|
||||
bool W433DataReciver::reciveSync(const uint16_t elapsedTime)
|
||||
{
|
||||
if(elapsedTime < SYNC_TIME+50 && elapsedTime > SYNC_TIME-50)
|
||||
if(elapsedTime < SYNC_TIME+SYNC_TIME_TOLERANCE && elapsedTime > SYNC_TIME-SYNC_TIME_TOLERANCE)
|
||||
{
|
||||
++syncCount;
|
||||
}
|
||||
|
Reference in New Issue
Block a user