gcode: Rework toolhead stalling to use greenlets

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2016-12-09 09:41:46 -05:00
parent 89f5452ddb
commit edd7dfe1c8
3 changed files with 23 additions and 35 deletions

View File

@@ -506,6 +506,8 @@ class MCU:
est_mcu_time = self.serial.get_clock(eventtime) / self._mcu_freq
self._print_start_time = est_mcu_time
def get_print_buffer_time(self, eventtime, print_time):
if self.is_shutdown:
return 0.
mcu_time = print_time + self._print_start_time
est_mcu_time = self.serial.get_clock(eventtime) / self._mcu_freq
return mcu_time - est_mcu_time