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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user