serialhdl: Make SerialReader.connect() blocking

Use the greenlet mechanism to wait for the connection to come up in
the serial connect() method.  This simplifies the calling code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-11-27 17:45:58 -05:00
parent 5d805ba550
commit 535c7b99b4
4 changed files with 34 additions and 42 deletions

View file

@ -85,9 +85,6 @@ class Printer:
def connect_file(self, output, dictionary):
self.reactor.update_timer(self.stats_timer, self.reactor.NEVER)
self.mcu.connect_file(output, dictionary)
self.build_config()
self.gcode.run()
self.reactor.unregister_timer(self.connect_timer)
def run(self):
self.reactor.run()
# If gcode exits, then exit the MCU