From b53da365a1d9a3cb2cf28acd9f09f43fa15a81ca Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 30 Sep 2016 16:00:32 -0400 Subject: 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 --- klippy/homing.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'klippy/homing.py') diff --git a/klippy/homing.py b/klippy/homing.py index 1bfe141e..9b405299 100644 --- a/klippy/homing.py +++ b/klippy/homing.py @@ -90,3 +90,11 @@ class QueryEndstops: msg = "TRIGGERED" msgs.append("%s:%s" % (name, msg)) return " ".join(msgs) + +class EndstopError(Exception): + def __init__(self, pos, msg="Move out of range"): + self.pos = pos + self.msg = msg + def __str__(self): + return "%s: %.3f %.3f %.3f [%.3f]" % ( + self.msg, self.pos[0], self.pos[1], self.pos[2], self.pos[3]) -- cgit v1.2.3-70-g09d2