aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-08-19 13:27:46 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-08-21 18:08:10 -0400
commit3ef6e2ba5692bebc3ea17f804af8e4223b3d8643 (patch)
tree51ceea7d8515b4fd175bc8f567ff866d515c1647 /klippy/extras
parent67d99fe8a85eed47caa73f9246ef7c66807ae3d5 (diff)
downloadkutter-3ef6e2ba5692bebc3ea17f804af8e4223b3d8643.tar.gz
kutter-3ef6e2ba5692bebc3ea17f804af8e4223b3d8643.tar.xz
kutter-3ef6e2ba5692bebc3ea17f804af8e4223b3d8643.zip
adxl345: Use config.getlist() for axes_map config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/adxl345.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/adxl345.py b/klippy/extras/adxl345.py
index 49e2888f..23167ffc 100644
--- a/klippy/extras/adxl345.py
+++ b/klippy/extras/adxl345.py
@@ -104,8 +104,8 @@ class ADXL345:
self.last_tx_time = 0.
am = {'x': (0, SCALE), 'y': (1, SCALE), 'z': (2, SCALE),
'-x': (0, -SCALE), '-y': (1, -SCALE), '-z': (2, -SCALE)}
- axes_map = config.get('axes_map', 'x,y,z').split(',')
- if len(axes_map) != 3 or any([a.strip() not in am for a in axes_map]):
+ axes_map = config.getlist('axes_map', ('x','y','z'), count=3)
+ if any([a not in am for a in axes_map]):
raise config.error("Invalid adxl345 axes_map parameter")
self.axes_map = [am[a.strip()] for a in axes_map]
self.data_rate = config.getint('rate', 3200)