From c632b377ca73a54463650f7a6c45d963cac2fed6 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 19 Jul 2021 12:28:32 -0400 Subject: [PATCH] mcu: Support returning the mcu reported shutdown time Signed-off-by: Kevin O'Connor --- klippy/mcu.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/klippy/mcu.py b/klippy/mcu.py index c9a2e133..1e3aa3b4 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -522,6 +522,7 @@ class MCU: self._reset_cmd = self._config_reset_cmd = None self._emergency_stop_cmd = None self._is_shutdown = self._is_timeout = False + self._shutdown_clock = 0 self._shutdown_msg = "" # Config building printer.lookup_object('pins').register_chip(self._name, self) @@ -565,6 +566,9 @@ class MCU: if self._is_shutdown: return self._is_shutdown = True + clock = params.get("clock") + if clock is not None: + self._shutdown_clock = self.clock32_to_clock64(clock) self._shutdown_msg = msg = params['static_string_id'] logging.info("MCU '%s' %s: %s\n%s\n%s", self._name, params['#name'], self._shutdown_msg, self._clocksync.dump_debug(), @@ -880,6 +884,8 @@ class MCU: return self._printer.get_start_args().get('debugoutput') is not None def is_shutdown(self): return self._is_shutdown + def get_shutdown_clock(self): + return self._shutdown_clock def flush_moves(self, print_time): if self._steppersync is None: return