diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-09-30 16:00:32 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-09-30 21:36:51 -0400 |
commit | b53da365a1d9a3cb2cf28acd9f09f43fa15a81ca (patch) | |
tree | 9c7c75b7c3aae1cbdfc079c19a83f1b9d2005e6e /klippy/gcode.py | |
parent | 275b38685603eb34f832dfc3fbd8b63e5f610e18 (diff) | |
download | kutter-b53da365a1d9a3cb2cf28acd9f09f43fa15a81ca.tar.gz kutter-b53da365a1d9a3cb2cf28acd9f09f43fa15a81ca.tar.xz kutter-b53da365a1d9a3cb2cf28acd9f09f43fa15a81ca.zip |
cartesian: Enforce endstop min and max boundaries
Verify that each move command is within range of the configured
minimum and maximum for each axis.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index 37dd3b23..4e7c9af5 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import os, re, logging, collections +import homing # Parse out incoming GCode and find and translate head movements class GCodeParser: @@ -223,7 +224,10 @@ class GCodeParser: self.last_position[p] = v + self.base_position[p] if 'F' in params: self.speed = float(params['F']) / 60. - self.toolhead.move(self.last_position, self.speed, sloppy) + try: + self.toolhead.move(self.last_position, self.speed, sloppy) + except homing.EndstopError, e: + self.respond("Error: %s" % (e,)) def cmd_G4(self, params): # Dwell if 'S' in params: |