minimize time to trinket is opened
authorTeodor Sigaev <teodor@sigaev.ru>
Wed, 6 Apr 2016 19:47:37 +0000 (22:47 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Wed, 6 Apr 2016 19:47:37 +0000 (22:47 +0300)
main.c

diff --git a/main.c b/main.c
index 722204c..ff77ec5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -90,6 +90,8 @@ main_loop() {
                        continue;
                }
 
+               trinketClose();
+
                if (collected <= tics) {
                        prevDose[collected++] = curDose;
                } else {
@@ -126,7 +128,6 @@ main_loop() {
                        }
                }
 
-               trinketClose();
                sleep(period);
        }
 }