From a445013f7a337e3c3c73544d12e36c1f1c9d0a2a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 11 Feb 2026 09:15:34 -0500 Subject: [PATCH] configfile: Add support for warning on deprecated mcu code Signed-off-by: Kevin O'Connor --- klippy/configfile.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/klippy/configfile.py b/klippy/configfile.py index 754fc974f..d37404c25 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -529,6 +529,17 @@ class PrinterConfig: res = {'type': 'deprecated_gcode', 'message': msg, 'command': cmd, 'parameter': param, 'value': str(value)} self._add_deprecated(res) + def deprecate_mcu_code(self, mcu, feature, msg=None): + mcu_name = mcu.get_name() + if msg is None: + vhost = self.printer.start_args['software_version'] + vmcu = mcu.get_status()['mcu_version'] + msg = ("MCU '%s' has deprecated code (it is missing feature '%s')." + " Recompiling and flashing is recommended (MCU version '%s'," + " host version '%s')." % (mcu_name, feature, vmcu, vhost)) + res = {'type': 'deprecated_mcu_code', 'message': msg, + 'mcu': mcu_name, 'feature': feature} + self._add_deprecated(res) # Status reporting def _build_status_config(self, config): self.status_raw_config = {}