From e532b75e21bb7bcadd85496f0c090405c0f81e2b Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 12 Nov 2019 22:12:25 -0500 Subject: [PATCH] mcu: Minor simplification to default reset detection Signed-off-by: Kevin O'Connor --- klippy/mcu.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/klippy/mcu.py b/klippy/mcu.py index 4f045263..3cabac38 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -556,11 +556,9 @@ 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") - msgparser = self._serial.get_msgparser() - if (self._restart_method is None - and (self._reset_cmd is not None - or self._config_reset_cmd is not None) - and msgparser.get_constant('SERIAL_BAUD', None) is None): + ext_only = self._reset_cmd is None and self._config_reset_cmd is None + mbaud = self._serial.get_msgparser().get_constant('SERIAL_BAUD', None) + if self._restart_method is None and mbaud is None and not ext_only: self._restart_method = 'command' self.register_response(self._handle_shutdown, 'shutdown') self.register_response(self._handle_shutdown, 'is_shutdown')