altos: Don't validate ADXL375 self test for maximum value
authorKeith Packard <keithp@keithp.com>
Sun, 30 Dec 2018 22:11:03 +0000 (14:11 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 30 Dec 2018 22:17:27 +0000 (14:17 -0800)
The data sheet says this is unreliable, and that we should be using an
FFT anyways.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_adxl375.c

index 778c214b6e49b637a0ebd0be74b65c5de1120b68..66d39ff915b625c6f87acac828594ff1f8a6ad4b 100644 (file)
@@ -172,7 +172,6 @@ ao_adxl375_setup(void)
                             (0 << AO_ADXL375_POWER_CTL_SLEEP) |
                             (AO_ADXL375_POWER_CTL_WAKEUP_8 << AO_ADXL375_POWER_CTL_WAKEUP));
 
-       (void) ao_adxl375_total_value;
        /* Perform self-test */
 
        struct ao_adxl375_total self_test_off, self_test_on;
@@ -204,9 +203,16 @@ ao_adxl375_setup(void)
 
        self_test_value = z_change;
 
-       if (z_change < MIN_SELF_TEST || MAX_SELF_TEST < z_change)
+       if (z_change < MIN_SELF_TEST)
                ao_sensor_errors = 1;
 
+       /* This check is commented out as maximum self test is unreliable
+
+          if (z_change > MAX_SELF_TEST)
+               ao_sensor_errors = 1;
+
+       */
+
        /* Discard some samples to let it settle down */
        ao_adxl375_total_value(&self_test_off, AO_ADXL375_SELF_TEST_SETTLE);
 }