diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-01-29 10:10:27 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-01-29 10:10:27 -0500 |
commit | a67306c76b0c0c2083f9e39e1186a7c3e0550744 (patch) | |
tree | 87e43e37f2de79e92236a1ed7f3e94783f2d8173 /klippy/serialhdl.py | |
parent | 6eefbe5e3069c70bb8c9e2d55b087ae8a6c27fee (diff) | |
download | kutter-a67306c76b0c0c2083f9e39e1186a7c3e0550744.tar.gz kutter-a67306c76b0c0c2083f9e39e1186a7c3e0550744.tar.xz kutter-a67306c76b0c0c2083f9e39e1186a7c3e0550744.zip |
msgproto: Support default values in get_constant() calls
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialhdl.py')
-rw-r--r-- | klippy/serialhdl.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py index 08f7ef23..6040f3ab 100644 --- a/klippy/serialhdl.py +++ b/klippy/serialhdl.py @@ -90,8 +90,8 @@ class SerialReader: logging.info("MCU config: %s", " ".join( ["%s=%s" % (k, v) for k, v in msgparser.config.items()])) # Setup baud adjust - mcu_baud = float(msgparser.config.get('SERIAL_BAUD', 0.)) - if mcu_baud: + mcu_baud = msgparser.get_constant_float('SERIAL_BAUD', None) + if mcu_baud is not None: baud_adjust = self.BITS_PER_BYTE / mcu_baud self.ffi_lib.serialqueue_set_baud_adjust( self.serialqueue, baud_adjust) |