Merge pull request #8830 from justifiably/LMT01

Spurious low LMT01 pulse are sometimes seen, ignore them.
This commit is contained in:
Theo Arends 2020-07-01 17:47:27 +02:00 committed by GitHub
commit 8e80bc8f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,8 @@ int LMT01_getPulses(void) {
hold = lmt01_pulseCount; hold = lmt01_pulseCount;
delay(1); delay(1);
} }
if (timeout > 0) { // discard spurious low counts
if (timeout > 0 && hold >= 10) {
return hold; return hold;
} }
return -1; return -1;