Skip to content

Commit

Permalink
searpate disengage and stop
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Jul 27, 2023
1 parent b0f5fa6 commit b077d0c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,25 @@ async def _chained_calls() -> None:

asyncio.run_coroutine_threadsafe(_chained_calls(), self._loop)

async def halt(self) -> None:
"""Immediately stop motion."""
async def stop_motors(self) -> None:
"""Immediately stop motors."""
await self._backend.halt()

def stop_modules(self) -> None:
"""Immediately stop modules."""
asyncio.run_coroutine_threadsafe(self._execution_manager.cancel(), self._loop)

async def halt(self) -> None:
"""Immediately disengage all present motors and clear motor and module tasks."""
await self.disengage_axes(
[ax for ax in Axis if self._backend.axis_is_present(ax)]
)
await self.stop_motors()
self.stop_modules()

async def stop(self, home_after: bool = True) -> None:
"""Stop motion as soon as possible, reset, and optionally home."""
await self._backend.halt()
await self.stop_motors()
self._log.info("Recovering from halt")
await self.reset()

Expand Down

0 comments on commit b077d0c

Please sign in to comment.