diff options
author | Keith Packard <keithp@keithp.com> | 2012-05-27 16:46:00 -0600 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-05-27 16:46:00 -0600 |
commit | 9eeba439ce8c9dc1def8528f96b6a67c6578d656 (patch) | |
tree | 49ef7074be77e56e80e01dcb3674cde2e0dc7ec9 /src/drivers/ao_mpu6000.c | |
parent | d01c10eff4b70af13347969a7cece8730cf1a3f1 (diff) |
altos: Don't start ADC ring until the other sensors have a valid value
Yes, this is still an ugly kludge, but it's easy.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_mpu6000.c')
-rw-r--r-- | src/drivers/ao_mpu6000.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/ao_mpu6000.c b/src/drivers/ao_mpu6000.c index df400fcb..065ed221 100644 --- a/src/drivers/ao_mpu6000.c +++ b/src/drivers/ao_mpu6000.c @@ -246,6 +246,7 @@ ao_mpu6000_setup(void) } struct ao_mpu6000_sample ao_mpu6000_current; +uint8_t ao_mpu6000_valid; static void ao_mpu6000(void) @@ -257,6 +258,7 @@ ao_mpu6000(void) ao_mpu6000_sample(&ao_mpu6000_next); ao_arch_critical( ao_mpu6000_current = ao_mpu6000_next; + ao_mpu6000_valid = 1; ); ao_delay(0); } @@ -288,6 +290,7 @@ void ao_mpu6000_init(void) { ao_mpu6000_configured = 0; + ao_mpu6000_valid = 0; ao_add_task(&ao_mpu6000_task, ao_mpu6000, "mpu6000"); ao_cmd_register(&ao_mpu6000_cmds[0]); |