summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-12-30 14:11:03 -0800
committerKeith Packard <keithp@keithp.com>2018-12-30 14:17:27 -0800
commit0d472ab07224a21abfa83da8336439d7844f9aa8 (patch)
tree14c0f49b37758c130bfa37332e3c9e41f8c4924d /src
parent4fb00afc9018c6179c4aff897fcbb330588d02a2 (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/ao_adxl375.c10
1 files changed, 8 insertions, 2 deletions
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);
}