From ff7fa802f632700f73418246f1be5017ac0a09b4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 17 Jun 2019 23:43:02 -0700 Subject: [PATCH] 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 --- src/drivers/ao_ms5607.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.30.2