changeset 1128:d2fb69d9722d

take out deferToThread Ignore-this: 83a2ce5435b2d224cde0cdc39b9cfeaf
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 13 Jun 2014 08:14:53 +0000
parents b0b9b4616e16
children 38802eaca8fc
files light9/effecteval/effectloop.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/light9/effecteval/effectloop.py	Fri Jun 13 08:04:07 2014 +0000
+++ b/light9/effecteval/effectloop.py	Fri Jun 13 08:14:53 2014 +0000
@@ -172,12 +172,14 @@
         for which, px255 in combined.items():
             if which == 'blacklight':
                 if px255 != self.lastSentBacklight:
-                    yield threads.deferToThread(self.serialWrite, self.boards['L'], '\x60\x01' + chr(px255))
+                    yield succeed(self.serialWrite(self.boards['L'], '\x60\x01' + chr(px255))
                     self.lastSentBacklight = px255
             else:
                 board = self.boards[which]
                 msg = '\x60\x00' + px255.reshape((-1,)).tostring()
-                yield threads.deferToThread(self.serialWrite, board, msg)
+                # may be stuttering more, and not smoother
+                #yield threads.deferToThread(self.serialWrite, board, msg)
+                yield succeed(self.serialWrite(board, msg))
 
     def serialWrite(self, serial, msg):
         serial.write(msg)