From: Keith Packard Date: Tue, 18 Jun 2019 06:43:02 +0000 (-0700) Subject: altos: Support ao_ms5607_dump when no ms5607 task X-Git-Tag: 1.9.1~1^2~81 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ff7fa802f632700f73418246f1be5017ac0a09b4;p=fw%2Faltos 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 --- 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);