Browse files

Drop frames so as not to fall behind.

  • Loading branch information...
1 parent 2f06080 commit 6d68c7dc2d89e30ecf7718bf3457a60c170b10a6 @cibomahto cibomahto committed May 12, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 host/domelistener.py
View
11 host/domelistener.py
@@ -16,14 +16,14 @@
# Serial port settings
strip_names = [
['/dev/tty.usbmodem12341', 0],
-# ['/dev/tty.usbmodem63', 8],
-# ['/dev/tty.usbmodem64', 16],
+ ['/dev/tty.usbmodem107', 8],
+ ['/dev/tty.usbmodem108', 16],
]
class threadedLedStrips(threading.Thread):
- q = Queue.Queue()
+ q = Queue.Queue(1)
def __init__(self, port_name, offset):
threading.Thread.__init__(self)
@@ -66,7 +66,10 @@ def run(self):
continue
for strip in strips:
- strip.q.put(data[1:])
+ if strip.q.full():
+ print "dropped a frame!"
+ else:
+ strip.q.put(data[1:])
frame_count = (frame_count + 1) % 30
if (frame_count == 0):

0 comments on commit 6d68c7d

Please sign in to comment.