endstop_phase: Move endstop phase homing code to new "extras" module

Move the endstop phase tracking code from stepper.py to a new
extras/endstop_phase.py module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-10-09 21:36:02 -04:00
parent 216905ceca
commit a2df01b88e
5 changed files with 114 additions and 89 deletions

View file

@ -124,14 +124,14 @@ class Homing:
self.toolhead.set_position(forcepos)
self.homing_move(movepos, endstops, second_homing_speed,
verify_movement=self.verify_retract)
# Apply homing offsets
for rail in rails:
cp = rail.get_commanded_position()
rail.set_commanded_position(cp + rail.get_homed_offset())
adjustpos = self.toolhead.get_kinematics().calc_position()
for axis in homing_axes:
movepos[axis] = adjustpos[axis]
self.toolhead.set_position(movepos)
# Signal home operation complete
ret = self.printer.send_event("homing:homed_rails", self, rails)
if any(ret):
# Apply any homing offsets
adjustpos = self.toolhead.get_kinematics().calc_position()
for axis in homing_axes:
movepos[axis] = adjustpos[axis]
self.toolhead.set_position(movepos)
def home_axes(self, axes):
self.changed_axes = axes
try: