aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/gcode.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-02-06 13:31:34 -0500
committerKevin O'Connor <kevin@koconnor.net>2017-02-06 13:31:34 -0500
commit20d0936fa256e0caa41a18a79556c8ade3f8347f (patch)
tree230424417d2f1b0c148d677ecf3d1003dfd943ac /klippy/gcode.py
parentc24b7a7ef96b6c9770fdf4c821f5719892732033 (diff)
downloadkutter-20d0936fa256e0caa41a18a79556c8ade3f8347f.tar.gz
kutter-20d0936fa256e0caa41a18a79556c8ade3f8347f.tar.xz
kutter-20d0936fa256e0caa41a18a79556c8ade3f8347f.zip
reactor: Use the system monotonic clock instead of the normal system clock
The normal system clock can have sudden jumps if the system clock is changed. Use the system monotonic clock to avoid these sudden changes in time. It appears the Raspbian OS (which is used by OctoPi) is setup to update the system clock upon network connectivity. This could cause sudden system clock changes which could lead to Klippy processing errors. Using the monotonic clock eliminates these issues. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r--klippy/gcode.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index 407390e1..8b33e26a 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -3,7 +3,7 @@
# Copyright (C) 2016 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import os, re, logging, collections, time
+import os, re, logging, collections
import homing
# Parse out incoming GCode and find and translate head movements
@@ -179,7 +179,7 @@ class GCodeParser:
def bg_temp(self, heater):
if self.is_fileinput:
return
- eventtime = time.time()
+ eventtime = self.reactor.monotonic()
while self.is_printer_ready and heater.check_busy(eventtime):
self.toolhead.reset_motor_off_time(eventtime)
self.respond(self.get_temp())