mcu: Don't call steppersync_flush if steppersync not created

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-12-28 22:17:49 -05:00
parent 860fc3e91d
commit d028f42e99
1 changed files with 2 additions and 0 deletions

View File

@ -521,6 +521,8 @@ class MCU:
def send(self, cmd, minclock=0, reqclock=0, cq=None):
self.serial.send(cmd, minclock, reqclock, cq=cq)
def flush_moves(self, print_time):
if self._steppersync is None:
return
mcu_time = print_time + self._print_start_time
clock = int(mcu_time * self._mcu_freq)
self.ffi_lib.steppersync_flush(self._steppersync, clock)