diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-12-21 18:18:18 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-12-21 20:32:10 -0500 |
commit | d778ae1846af85a95fc40f13b6af927ac758f854 (patch) | |
tree | be3a612525738fbdb42c3edd99f5b682a6c445ae /klippy | |
parent | 522093ef006294b81d1898851bbd69b46c5c70d5 (diff) | |
download | kutter-d778ae1846af85a95fc40f13b6af927ac758f854.tar.gz kutter-d778ae1846af85a95fc40f13b6af927ac758f854.tar.xz kutter-d778ae1846af85a95fc40f13b6af927ac758f854.zip |
build: Add gcc and binutils version to mcu data dictionary
Store the gcc and binutils versions used in the compilation of the
firmware in the firmware data dictionary. Forward that information to
the log so it is available during debugging.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/mcu.py | 4 | ||||
-rw-r--r-- | klippy/msgproto.py | 3 | ||||
-rw-r--r-- | klippy/serialhdl.py | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py index 78dfe9e7..136b3bc8 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -574,9 +574,9 @@ class MCU: msgparser = self._serial.msgparser info = [ "Configured MCU '%s' (%d moves)" % (self._name, move_count), - "Loaded MCU '%s' %d commands (%s)" % ( + "Loaded MCU '%s' %d commands (%s / %s)" % ( self._name, len(msgparser.messages_by_id), - msgparser.version), + msgparser.version, msgparser.build_versions), "MCU '%s' config: %s" % (self._name, " ".join( ["%s=%s" % (k, v) for k, v in msgparser.config.items()]))] self._printer.bglogger.set_rollover_info(self._name, "\n".join(info)) diff --git a/klippy/msgproto.py b/klippy/msgproto.py index 40138346..736fe1b8 100644 --- a/klippy/msgproto.py +++ b/klippy/msgproto.py @@ -188,7 +188,7 @@ class MessageParser: self.messages_by_name = {} self.static_strings = {} self.config = {} - self.version = "" + self.version = self.build_versions = "" self.raw_identify_data = "" self._init_messages(DefaultMessages, DefaultMessages.keys()) def check_packet(self, s): @@ -318,6 +318,7 @@ class MessageParser: self.static_strings = { int(k): v for k, v in static_strings.items() } self.config.update(data.get('config', {})) self.version = data.get('version', '') + self.build_versions = data.get('build_versions', '') except error as e: raise except Exception as e: diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py index e7e35bf8..08f7ef23 100644 --- a/klippy/serialhdl.py +++ b/klippy/serialhdl.py @@ -84,8 +84,9 @@ class SerialReader: msgparser.process_identify(identify_data) self.msgparser = msgparser self.register_callback(self.handle_unknown, '#unknown') - logging.info("Loaded %d commands (%s)", - len(msgparser.messages_by_id), msgparser.version) + logging.info("Loaded %d commands (%s / %s)", + len(msgparser.messages_by_id), + msgparser.version, msgparser.build_versions) logging.info("MCU config: %s", " ".join( ["%s=%s" % (k, v) for k, v in msgparser.config.items()])) # Setup baud adjust |