diff options
author | Arksine <arksine.code@gmail.com> | 2019-02-24 12:28:30 -0500 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-03-01 00:45:51 -0500 |
commit | 3cd1f9676d5ef6b25711a21ef89a37c7deb152d8 (patch) | |
tree | b08c5716d66519e4b5103afde86698740cf8e415 /klippy/extras/virtual_sdcard.py | |
parent | c8d7e28a35bc3d3699fa5b77327ad194fd3c3105 (diff) | |
download | kutter-3cd1f9676d5ef6b25711a21ef89a37c7deb152d8.tar.gz kutter-3cd1f9676d5ef6b25711a21ef89a37c7deb152d8.tar.xz kutter-3cd1f9676d5ef6b25711a21ef89a37c7deb152d8.zip |
pause_resume: Implement send_pause_command()
This allows for pausing from inside a reactor callback.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras/virtual_sdcard.py')
-rw-r--r-- | klippy/extras/virtual_sdcard.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index 91bd31a9..b4ee948c 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -60,6 +60,9 @@ class VirtualSD: return {'progress': progress} def is_active(self): return self.work_timer is not None + def do_pause(self): + if self.work_timer is not None: + self.must_pause_work = True # G-Code commands def cmd_error(self, params): raise self.gcode.error("SD write not supported") @@ -116,8 +119,7 @@ class VirtualSD: self.work_handler, self.reactor.NOW) def cmd_M25(self, params): # Pause SD print - if self.work_timer is not None: - self.must_pause_work = True + self.do_pause() def cmd_M26(self, params): # Set SD position if self.work_timer is not None: |