aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-04-11 11:37:09 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-04-11 11:42:55 -0400
commit7b03b04c786863bc32d3b790862857061f71f072 (patch)
tree4396da5121caf1f7f6e5072115a4ddff345fa476 /klippy/mcu.py
parent7a7b98cc31dff8cb7f1a6a1ab886362a0802be66 (diff)
downloadkutter-7b03b04c786863bc32d3b790862857061f71f072.tar.gz
kutter-7b03b04c786863bc32d3b790862857061f71f072.tar.xz
kutter-7b03b04c786863bc32d3b790862857061f71f072.zip
klippy: Support minimum/maximum value checks on configuration variables
Verify that numeric parameters are in a sane range when reading the config. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py
index 5b12e83f..50a0eab4 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -392,7 +392,8 @@ class MCU:
self._custom = config.get('custom', '')
# Move command queuing
ffi_main, self._ffi_lib = chelper.get_ffi()
- self._max_stepper_error = config.getfloat('max_stepper_error', 0.000025)
+ self._max_stepper_error = config.getfloat(
+ 'max_stepper_error', 0.000025, minval=0.)
self._steppers = []
self._steppersync = None
# Print time to clock epoch calculations