mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-16 11:17:52 -06:00
mcu: Integrate query_endstop_wait() into query_endstop()
There is no need to have two separate calls to query an endstop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
ced5e35f0c
commit
b2c778b931
5 changed files with 6 additions and 16 deletions
|
@ -234,10 +234,8 @@ class MCU_endstop:
|
|||
return True
|
||||
def query_endstop(self, print_time):
|
||||
self._homing = False
|
||||
self._min_query_time = self._mcu.monotonic()
|
||||
self._min_query_time = eventtime = self._mcu.monotonic()
|
||||
self._next_query_print_time = print_time
|
||||
def query_endstop_wait(self):
|
||||
eventtime = self._mcu.monotonic()
|
||||
while self._check_busy(eventtime):
|
||||
eventtime = self._mcu.pause(eventtime + 0.1)
|
||||
return self._last_state.get('pin_value', self._invert) ^ self._invert
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue