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>
This commit is contained in:
parent
40e2c64c82
commit
430ad0b658
|
@ -6,7 +6,6 @@
|
||||||
import os, logging
|
import os, logging
|
||||||
|
|
||||||
class VirtualSD:
|
class VirtualSD:
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
printer = config.get_printer()
|
printer = config.get_printer()
|
||||||
printer.register_event_handler("klippy:shutdown", self.handle_shutdown)
|
printer.register_event_handler("klippy:shutdown", self.handle_shutdown)
|
||||||
|
@ -65,6 +64,8 @@ class VirtualSD:
|
||||||
def do_pause(self):
|
def do_pause(self):
|
||||||
if self.work_timer is not None:
|
if self.work_timer is not None:
|
||||||
self.must_pause_work = True
|
self.must_pause_work = True
|
||||||
|
while self.work_timer is not None:
|
||||||
|
self.reactor.pause(self.reactor.monotonic() + .001)
|
||||||
# G-Code commands
|
# G-Code commands
|
||||||
def cmd_error(self, params):
|
def cmd_error(self, params):
|
||||||
raise self.gcode.error("SD write not supported")
|
raise self.gcode.error("SD write not supported")
|
||||||
|
|
Loading…
Reference in New Issue