aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py
index 06da3ea6..d91e6314 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -428,9 +428,9 @@ class MCU:
# Restarts
self._restart_method = 'command'
if baud:
- rmethods = {m: m for m in ['arduino', 'command', 'rpi_usb']}
+ rmethods = {m: m for m in [None, 'arduino', 'command', 'rpi_usb']}
self._restart_method = config.getchoice(
- 'restart_method', rmethods, 'arduino')
+ 'restart_method', rmethods, None)
self._reset_cmd = self._config_reset_cmd = None
self._emergency_stop_cmd = None
self._is_shutdown = self._is_timeout = False
@@ -600,6 +600,12 @@ class MCU:
self._emergency_stop_cmd = self.lookup_command("emergency_stop")
self._reset_cmd = self.try_lookup_command("reset")
self._config_reset_cmd = self.try_lookup_command("config_reset")
+ if (self._restart_method is None
+ and (self._reset_cmd is not None
+ or self.config_reset_cmd is not None)
+ and self._serial.msgparser.get_constant(
+ 'SERIAL_BAUD', None) is None):
+ self._restart_method = 'command'
self.register_msg(self.handle_shutdown, 'shutdown')
self.register_msg(self.handle_shutdown, 'is_shutdown')
self.register_msg(self.handle_mcu_stats, 'stats')