From: Teodor Sigaev Date: Wed, 20 Apr 2016 19:19:39 +0000 (+0300) Subject: add detection of reconnect X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=c8931da2925ab4fc4c9def8311228bb98ff7cb23;p=trinked.git add detection of reconnect --- 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 {