homing: Create QueryEndstops class from gcode

Create the QueryEndstops in the gcode handler instead of in the
kinematic classes.  This simplifies the gcode handler as it can
directly register its response callback.

Also, store the stepper name in the stepper class.  Also, propagate
the print_time of the query request to the mcu_endstop class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-11-17 17:24:03 -05:00
parent 7ef8c0442a
commit 9e1059afb4
8 changed files with 37 additions and 36 deletions

View file

@ -140,10 +140,11 @@ class MCU_endstop:
if self._stepper.get_invert_dir():
return -pos
return pos
def query_endstop(self):
def query_endstop(self, mcu_time):
clock = int(mcu_time * self._mcu_freq)
self._homing = False
self._min_query_time = time.time()
self._next_query_clock = 0
self._next_query_clock = clock
def get_last_triggered(self):
return self._last_state.get('pin', self._invert) ^ self._invert