From: Keith Packard Date: Sun, 30 Dec 2018 22:11:03 +0000 (-0800) Subject: altos: Don't validate ADXL375 self test for maximum value X-Git-Tag: 1.9~11 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=0d472ab07224a21abfa83da8336439d7844f9aa8;ds=sidebyside altos: Don't validate ADXL375 self test for maximum value The data sheet says this is unreliable, and that we should be using an FFT anyways. Signed-off-by: Keith Packard --- diff --git a/src/drivers/ao_adxl375.c b/src/drivers/ao_adxl375.c index 778c214b..66d39ff9 100644 --- a/src/drivers/ao_adxl375.c +++ b/src/drivers/ao_adxl375.c @@ -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); }