aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/virtual_sdcard.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/extras/virtual_sdcard.py')
-rw-r--r--klippy/extras/virtual_sdcard.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py
index 8d192c54..73e9b40d 100644
--- a/klippy/extras/virtual_sdcard.py
+++ b/klippy/extras/virtual_sdcard.py
@@ -91,6 +91,12 @@ class VirtualSD:
self.must_pause_work = True
while self.work_timer is not None and not self.cmd_from_sd:
self.reactor.pause(self.reactor.monotonic() + .001)
+ def do_resume(self):
+ if self.work_timer is not None:
+ raise self.gcode.error("SD busy")
+ self.must_pause_work = False
+ self.work_timer = self.reactor.register_timer(
+ self.work_handler, self.reactor.NOW)
# G-Code commands
def cmd_error(self, gcmd):
raise gcmd.error("SD write not supported")
@@ -167,11 +173,7 @@ class VirtualSD:
self.print_stats.set_current_file(filename)
def cmd_M24(self, gcmd):
# Start/resume SD print
- if self.work_timer is not None:
- raise gcmd.error("SD busy")
- self.must_pause_work = False
- self.work_timer = self.reactor.register_timer(
- self.work_handler, self.reactor.NOW)
+ self.do_resume()
def cmd_M25(self, gcmd):
# Pause SD print
self.do_pause()