diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-12-01 00:08:35 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-12-01 00:21:20 -0500 |
commit | d2ecc9d80c749454b3d14d547d8ec71c0c124fd1 (patch) | |
tree | e2db291926c8eca3bcd1f709013f4d3a19b933c8 /klippy/gcode.py | |
parent | fbd7cc243ba49b7e8ab0b435e319cf133dea5224 (diff) | |
download | kutter-d2ecc9d80c749454b3d14d547d8ec71c0c124fd1.tar.gz kutter-d2ecc9d80c749454b3d14d547d8ec71c0c124fd1.tar.xz kutter-d2ecc9d80c749454b3d14d547d8ec71c0c124fd1.zip |
gcode: Add support for CLEAR_SHUTDOWN command
Add ability to clear the MCU shutdown flag from the console.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index 0f4bc603..454d52fc 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -47,7 +47,7 @@ class GCodeParser: def build_handlers(self): handlers = ['G1', 'G4', 'G20', 'G21', 'G28', 'G90', 'G91', 'G92', 'M18', 'M82', 'M83', 'M105', 'M110', 'M114', 'M206', - 'HELP', 'QUERY_ENDSTOPS', 'RESTART'] + 'HELP', 'QUERY_ENDSTOPS', 'RESTART', 'CLEAR_SHUTDOWN'] if self.heater_nozzle is not None: handlers.extend(['M104', 'M109', 'PID_TUNE']) if self.heater_bed is not None: @@ -367,6 +367,14 @@ class GCodeParser: temp = float(params.get('S', '60')) heater.start_auto_tune(temp) self.bg_temp(heater) + cmd_CLEAR_SHUTDOWN_when_not_ready = True + cmd_CLEAR_SHUTDOWN_help = "Clear 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_restart() cmd_RESTART_when_not_ready = True cmd_RESTART_help = "Reload config file and restart host software" def cmd_RESTART(self, params): |