stepper: Add a config check for obvious incorrect homing_positive_dir

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-03-24 15:48:49 -04:00
parent 302cd38217
commit 8a3233b397
2 changed files with 9 additions and 1 deletions

View file

@ -252,6 +252,13 @@ class PrinterRail:
raise config.error(
"Unable to infer homing_positive_dir in section '%s'" % (
config.get_name(),))
elif ((self.homing_positive_dir
and self.position_endstop == self.position_min)
or (not self.homing_positive_dir
and self.position_endstop == self.position_max)):
raise config.error(
"Invalid homing_positive_dir / position_endstop in '%s'"
% (config.get_name(),))
def get_range(self):
return self.position_min, self.position_max
def get_homing_info(self):