From 3f84501955c9eb6774f1a3ad0069dbda103bdbae Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 17 Dec 2023 02:10:43 -0500 Subject: adxl345: Add a read_axes_map() helper function Signed-off-by: Kevin O'Connor --- klippy/extras/lis2dw.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'klippy/extras/lis2dw.py') diff --git a/klippy/extras/lis2dw.py b/klippy/extras/lis2dw.py index 7eaf38d7..82673fc8 100644 --- a/klippy/extras/lis2dw.py +++ b/klippy/extras/lis2dw.py @@ -42,12 +42,7 @@ class LIS2DW: def __init__(self, config): self.printer = config.get_printer() adxl345.AccelCommandHelper(config, self) - am = {'x': (0, SCALE), 'y': (1, SCALE), 'z': (2, SCALE), - '-x': (0, -SCALE), '-y': (1, -SCALE), '-z': (2, -SCALE)} - 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 lis2dw axes_map parameter") - self.axes_map = [am[a.strip()] for a in axes_map] + self.axes_map = adxl345.read_axes_map(config) self.data_rate = 1600 # Setup mcu sensor_lis2dw bulk query code self.spi = bus.MCU_SPI_from_config(config, 3, default_speed=5000000) -- cgit v1.2.3-70-g09d2