diff options
author | Keith Packard <keithp@keithp.com> | 2019-06-17 23:43:02 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2019-06-17 23:43:02 -0700 |
commit | ff7fa802f632700f73418246f1be5017ac0a09b4 (patch) | |
tree | c01bae374eaa89a03a031e53ad3db13ec6567a67 /src/drivers/ao_ms5607.c | |
parent | 7c5ba25e61f98fd4537062dce52ab22d1445fa24 (diff) |
altos: Support ao_ms5607_dump when no ms5607 task
MicroPeak v2.0 has tasking support, but doesn't have a separate ms5607
task. That means the device isn't getting initialized when not running
the flight code, so in cmd mode we need to make sure it's initialized,
and we also need to actually fetch a value to display.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_ms5607.c')
-rw-r--r-- | src/drivers/ao_ms5607.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c index e2327bf4..288d14ed 100644 --- a/src/drivers/ao_ms5607.c +++ b/src/drivers/ao_ms5607.c @@ -255,6 +255,11 @@ ao_ms5607_dump(void) { struct ao_ms5607_value value; +#if !HAS_MS5607_TASK + ao_ms5607_setup(); + ao_ms5607_info(); + ao_ms5607_sample(&ao_ms5607_current); +#endif ao_ms5607_convert(&ao_ms5607_current, &value); printf ("Pressure: %8lu %8ld\n", ao_ms5607_current.pres, value.pres); printf ("Temperature: %8lu %8ld\n", ao_ms5607_current.temp, value.temp); |