altos: Fix up ms5607 and mma655x commands to work again
authorKeith Packard <keithp@keithp.com>
Tue, 9 Oct 2012 06:24:19 +0000 (23:24 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 9 Oct 2012 06:24:19 +0000 (23:24 -0700)
These just display the most recently fetched values

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_mma655x.c
src/drivers/ao_ms5607.c

index 18c5317ce8c89f6d4791062f2fec1b4d04940223..28fe1e08b1d28b46354ce0200d2954aaacb826d3 100644 (file)
@@ -238,11 +238,12 @@ ao_mma655x_setup(void)
 
 }
 
+uint16_t       ao_mma655x_current;
+
 static void
 ao_mma655x_dump(void)
 {
-       ao_mma655x_setup();
-       printf ("MMA655X value %d\n", ao_mma655x_value());
+       printf ("MMA655X value %d\n", ao_mma655x_current);
 }
 
 __code struct ao_cmds ao_mma655x_cmds[] = {
@@ -250,8 +251,6 @@ __code struct ao_cmds ao_mma655x_cmds[] = {
        { 0, NULL },
 };
 
-uint16_t       ao_mma655x_current;
-
 static void
 ao_mma655x(void)
 {
index 492199b8b4061d4d1d856f3f6b770d13efcbc1a5..736e115bd560d6fa938dea948aaa3f917fd5719c 100644 (file)
@@ -241,13 +241,11 @@ ao_ms5607_info(void)
 static void
 ao_ms5607_dump(void)
 {
-       struct ao_data  data;
        struct ao_ms5607_value value;
 
-       ao_data_get(&data);
-       ao_ms5607_convert(&data.ms5607_raw, &value);
-       printf ("Pressure:    %8u %8d\n", data.ms5607_raw.pres, value.pres);
-       printf ("Temperature: %8u %8d\n", data.ms5607_raw.temp, value.temp);
+       ao_ms5607_convert(&ao_ms5607_current, &value);
+       printf ("Pressure:    %8u %8d\n", ao_ms5607_current.pres, value.pres);
+       printf ("Temperature: %8u %8d\n", ao_ms5607_current.temp, value.temp);
        printf ("Altitude: %ld\n", ao_pa_to_altitude(value.pres));
 }