From cbe790c90c1f1d540a5279f9a8662987af898837 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Sun, 18 Sep 2022 11:37:58 -0600 Subject: [PATCH] ok --- src/.prototype/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/.prototype/main.py b/src/.prototype/main.py index 259fd11..25db913 100644 --- a/src/.prototype/main.py +++ b/src/.prototype/main.py @@ -38,6 +38,9 @@ class InputBuffer(threading.Thread): def interval(): return .1 + def sticky_duration(): + return 1 + def stop(self): self.done = True self.q.put(None) @@ -124,8 +127,8 @@ class InputBuffer(threading.Thread): latest = b oldest = a if latest.v == None: - t_a_few_intervals_ago = InputBuffer.now() - InputBuffer.interval() * 10 - if oldest.t > t_a_few_intervals_ago: + a_few_t_ago = InputBuffer.now() - InputBuffer.sticky_duration() + if oldest.t > a_few_t_ago: return oldest return latest