mirror of https://github.com/Desuuuu/klipper.git
klippy: Always recommend a FIRMWARE_RESTART on a shutdown event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
10e11950ae
commit
c70cc8fadb
|
@ -227,7 +227,7 @@ class Printer:
|
||||||
run_result = self.run_result
|
run_result = self.run_result
|
||||||
try:
|
try:
|
||||||
if run_result == 'shutdown':
|
if run_result == 'shutdown':
|
||||||
self.invoke_shutdown(self.async_shutdown_msg, True)
|
self.invoke_shutdown(self.async_shutdown_msg)
|
||||||
continue
|
continue
|
||||||
self._stats(self.reactor.monotonic(), force_output=True)
|
self._stats(self.reactor.monotonic(), force_output=True)
|
||||||
for m in self.mcus:
|
for m in self.mcus:
|
||||||
|
@ -239,14 +239,11 @@ class Printer:
|
||||||
return run_result
|
return run_result
|
||||||
def get_state_message(self):
|
def get_state_message(self):
|
||||||
return self.state_message
|
return self.state_message
|
||||||
def invoke_shutdown(self, msg, is_mcu_shutdown=False):
|
def invoke_shutdown(self, msg):
|
||||||
if self.is_shutdown:
|
if self.is_shutdown:
|
||||||
return
|
return
|
||||||
self.is_shutdown = True
|
self.is_shutdown = True
|
||||||
if is_mcu_shutdown:
|
|
||||||
self.state_message = "%s%s" % (msg, message_shutdown)
|
self.state_message = "%s%s" % (msg, message_shutdown)
|
||||||
else:
|
|
||||||
self.state_message = "%s%s" % (msg, message_restart)
|
|
||||||
for m in self.mcus:
|
for m in self.mcus:
|
||||||
m.do_shutdown()
|
m.do_shutdown()
|
||||||
self.gcode.do_shutdown()
|
self.gcode.do_shutdown()
|
||||||
|
|
Loading…
Reference in New Issue