klippy: Remove CLEAR_SHUTDOWN command
Advice users to issue a FIRMWARE_RESTART command on a printer shutdown event, and remove support for CLEAR_SHUTDOWN. A full mcu reset is preferable and it simplifies the interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
4c25eae9b4
commit
8920479f85
|
@ -47,7 +47,7 @@ class GCodeParser:
|
||||||
handlers = ['G1', 'G4', 'G20', 'G21', 'G28', 'G90', 'G91', 'G92',
|
handlers = ['G1', 'G4', 'G20', 'G21', 'G28', 'G90', 'G91', 'G92',
|
||||||
'M18', 'M82', 'M83', 'M105', 'M110', 'M112', 'M114', 'M115',
|
'M18', 'M82', 'M83', 'M105', 'M110', 'M112', 'M114', 'M115',
|
||||||
'M206', 'M400',
|
'M206', 'M400',
|
||||||
'HELP', 'QUERY_ENDSTOPS', 'CLEAR_SHUTDOWN',
|
'HELP', 'QUERY_ENDSTOPS',
|
||||||
'RESTART', 'FIRMWARE_RESTART', 'STATUS']
|
'RESTART', 'FIRMWARE_RESTART', 'STATUS']
|
||||||
if self.heater_nozzle is not None:
|
if self.heater_nozzle is not None:
|
||||||
handlers.extend(['M104', 'M109', 'PID_TUNE'])
|
handlers.extend(['M104', 'M109', 'PID_TUNE'])
|
||||||
|
@ -394,14 +394,6 @@ class GCodeParser:
|
||||||
temp = self.get_float('S', params)
|
temp = self.get_float('S', params)
|
||||||
heater.start_auto_tune(temp)
|
heater.start_auto_tune(temp)
|
||||||
self.bg_temp(heater)
|
self.bg_temp(heater)
|
||||||
cmd_CLEAR_SHUTDOWN_when_not_ready = True
|
|
||||||
cmd_CLEAR_SHUTDOWN_help = "Clear a firmware shutdown and restart"
|
|
||||||
def cmd_CLEAR_SHUTDOWN(self, params):
|
|
||||||
if self.toolhead is None:
|
|
||||||
self.cmd_default(params)
|
|
||||||
return
|
|
||||||
self.printer.mcu.clear_shutdown()
|
|
||||||
self.printer.request_exit('restart')
|
|
||||||
def prep_restart(self):
|
def prep_restart(self):
|
||||||
if self.is_printer_ready:
|
if self.is_printer_ready:
|
||||||
self.respond_info("Preparing to restart...")
|
self.respond_info("Preparing to restart...")
|
||||||
|
|
|
@ -39,9 +39,9 @@ Error configuring printer
|
||||||
"""
|
"""
|
||||||
|
|
||||||
message_shutdown = """
|
message_shutdown = """
|
||||||
Once the underlying issue is corrected, the "CLEAR_SHUTDOWN"
|
Once the underlying issue is corrected, use the
|
||||||
command can be used to clear the firmware flag and restart
|
"FIRMWARE_RESTART" command to reset the firmware, reload the
|
||||||
the host software.
|
config, and restart the host software.
|
||||||
Printer is shutdown
|
Printer is shutdown
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,6 @@ class MCU:
|
||||||
# Config building
|
# Config building
|
||||||
self._config_error = config.error
|
self._config_error = config.error
|
||||||
self._emergency_stop_cmd = self._reset_cmd = None
|
self._emergency_stop_cmd = self._reset_cmd = None
|
||||||
self._clear_shutdown_cmd = None
|
|
||||||
self._oids = []
|
self._oids = []
|
||||||
self._config_cmds = []
|
self._config_cmds = []
|
||||||
self._config_crc = None
|
self._config_crc = None
|
||||||
|
@ -444,7 +443,6 @@ class MCU:
|
||||||
self._stats_sumsq_base = self.serial.msgparser.get_constant_float(
|
self._stats_sumsq_base = self.serial.msgparser.get_constant_float(
|
||||||
'STATS_SUMSQ_BASE')
|
'STATS_SUMSQ_BASE')
|
||||||
self._emergency_stop_cmd = self.lookup_command("emergency_stop")
|
self._emergency_stop_cmd = self.lookup_command("emergency_stop")
|
||||||
self._clear_shutdown_cmd = self.lookup_command("clear_shutdown")
|
|
||||||
try:
|
try:
|
||||||
self._reset_cmd = self.lookup_command("reset")
|
self._reset_cmd = self.lookup_command("reset")
|
||||||
except self.serial.msgparser.error, e:
|
except self.serial.msgparser.error, e:
|
||||||
|
@ -484,9 +482,6 @@ class MCU:
|
||||||
self._mcu_tick_avg, self._mcu_tick_stddev)
|
self._mcu_tick_avg, self._mcu_tick_stddev)
|
||||||
def force_shutdown(self):
|
def force_shutdown(self):
|
||||||
self.send(self._emergency_stop_cmd.encode())
|
self.send(self._emergency_stop_cmd.encode())
|
||||||
def clear_shutdown(self):
|
|
||||||
logging.info("Sending clear_shutdown command")
|
|
||||||
self.send(self._clear_shutdown_cmd.encode())
|
|
||||||
def microcontroller_restart(self):
|
def microcontroller_restart(self):
|
||||||
reactor = self._printer.reactor
|
reactor = self._printer.reactor
|
||||||
if self._restart_method == 'rpi_usb':
|
if self._restart_method == 'rpi_usb':
|
||||||
|
|
Loading…
Reference in New Issue