From a12b785bb7b853742c1dc4e31afc6623e49ca1aa Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Thu, 26 Jan 2017 20:36:32 +0200 Subject: [PATCH] onewire_parser: Increase glitch detection retry count to 4 In order to detect glitches properly, we might need to do more than two reads, especially on noisy lines. Double the amount of reads we do so that we have better chance of removing glitches from the data. Signed-off-by: Timo Kokkonen --- onewire_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onewire_parser.c b/onewire_parser.c index 7df7aa1..937400b 100644 --- a/onewire_parser.c +++ b/onewire_parser.c @@ -298,7 +298,7 @@ undefined: } if (might_be_glitch(data, &state[i]) && - glitches < 2 && retries < 7) { + glitches < 4 && retries < 7) { glitches++; prev_data = data; pr_info("Retrying due to a glitch: %f\n", data); -- 2.44.0