aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/virtual_sdcard.py
diff options
context:
space:
mode:
authorClifford Roche <clifford.roche@gmail.com>2021-03-26 11:21:10 -0400
committerGitHub <noreply@github.com>2021-03-26 11:21:10 -0400
commite2a321728900a16555b10e683013bf7c90bf64c8 (patch)
treeb5d27eca19229909e107aa5e4beb495b4ca2498f /klippy/extras/virtual_sdcard.py
parenta0307c0e1c8d9ee473ebf018dc9c92100b45f9f9 (diff)
downloadkutter-e2a321728900a16555b10e683013bf7c90bf64c8.tar.gz
kutter-e2a321728900a16555b10e683013bf7c90bf64c8.tar.xz
kutter-e2a321728900a16555b10e683013bf7c90bf64c8.zip
palette2: Add support for P2 devices (#4057)
Module which bring support for P2 devices running in connected mode. This enables using a Palette2 directly with Klippy without Octoprint, or without Palette2 plugins for Octoprint which are not functional out of the box with Klipper. Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
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()