diff --git a/src/IRrecv.cpp b/src/IRrecv.cpp index 4970dcf0b..ea92d5cf7 100644 --- a/src/IRrecv.cpp +++ b/src/IRrecv.cpp @@ -1079,7 +1079,7 @@ uint32_t IRrecv::ticksLow(const uint32_t usecs, const uint8_t tolerance, // max() used to ensure the result can't drop below 0 before the cast. return ((uint32_t)std::max( (int32_t)(usecs * (1.0 - _validTolerance(tolerance) / 100.0) - delta), - 0)); + (int32_t)0)); } /// Calculate the upper bound of the nr. of ticks. @@ -1162,7 +1162,8 @@ bool IRrecv::matchAtLeast(uint32_t measured, uint32_t desired, // We really should never get a value of 0, except as the last value // in the buffer. If that is the case, then assume infinity and return true. if (measured == 0) return true; - return measured >= ticksLow(std::min(desired, MS_TO_USEC(params.timeout)), + return measured >= ticksLow(std::min(desired, + (uint32_t)MS_TO_USEC(params.timeout)), tolerance, delta); }