From c8931da2925ab4fc4c9def8311228bb98ff7cb23 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Wed, 20 Apr 2016 22:19:39 +0300 Subject: [PATCH] add detection of reconnect --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index f283be0..b4d75a1 100644 --- a/main.c +++ b/main.c @@ -93,6 +93,12 @@ main_loop() { trinketClose(); + if (collected > 0 && prevDose[collected - 1] > curDose) + { + tlog(TL_WARN, "Reconnect or full reset detected"); + collected = 0; + } + if (collected <= tics) { prevDose[collected++] = curDose; } else { -- 2.46.1