aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/virtual_sdcard.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-10-30 14:21:28 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-10-31 11:36:35 -0400
commit430ad0b65841419e2e24ab926314236c01a07476 (patch)
treeddbf76c17e7e9ce618a540904f49fba37b99744c /klippy/extras/virtual_sdcard.py
parent40e2c64c8208b00fbc2b80187756aee9de2713b0 (diff)
downloadkutter-430ad0b65841419e2e24ab926314236c01a07476.tar.gz
kutter-430ad0b65841419e2e24ab926314236c01a07476.tar.xz
kutter-430ad0b65841419e2e24ab926314236c01a07476.zip
virtual_sdcard: Only return from M25 after print confirmed paused
Wait in the M25 command handler until the work_handler() background timer fully exits. This ensures that subsequent g-code commands (such as M27 or M24) will correctly report a paused state. Reported by @foosel. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/virtual_sdcard.py')
-rw-r--r--klippy/extras/virtual_sdcard.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py
index c25bbc78..6cdfacd4 100644
--- a/klippy/extras/virtual_sdcard.py
+++ b/klippy/extras/virtual_sdcard.py
@@ -6,7 +6,6 @@
import os, logging
class VirtualSD:
-
def __init__(self, config):
printer = config.get_printer()
printer.register_event_handler("klippy:shutdown", self.handle_shutdown)
@@ -65,6 +64,8 @@ class VirtualSD:
def do_pause(self):
if self.work_timer is not None:
self.must_pause_work = True
+ while self.work_timer is not None:
+ self.reactor.pause(self.reactor.monotonic() + .001)
# G-Code commands
def cmd_error(self, params):
raise self.gcode.error("SD write not supported")