altos: MPU6000 debug hacking
authorKeith Packard <keithp@keithp.com>
Tue, 14 May 2013 17:31:25 +0000 (10:31 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 14 May 2013 17:31:25 +0000 (10:31 -0700)
The 'I' command dumps the who-am-i register. the thread isn't running.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_mpu6000.c
src/telemega-v0.3/ao_pins.h

index 7bc37488402a64dde6aef86750f00fa14cef42e7..9bb99132d3b9b182276e4cb7a48e355df74d674c 100644 (file)
@@ -305,6 +305,7 @@ static struct ao_task ao_mpu6000_task;
 static void
 ao_mpu6000_show(void)
 {
+#if 0
        struct ao_data  sample;
 
        ao_data_get(&sample);
@@ -315,6 +316,8 @@ ao_mpu6000_show(void)
                sample.mpu6000.gyro_x,
                sample.mpu6000.gyro_y,
                sample.mpu6000.gyro_z);
+#endif
+       printf ("who-am-i: %02x\n", ao_mpu6000_reg_read(MPU6000_WHO_AM_I));
 }
 
 static const struct ao_cmds ao_mpu6000_cmds[] = {
@@ -327,7 +330,7 @@ ao_mpu6000_init(void)
 {
        ao_mpu6000_configured = 0;
 
-       ao_add_task(&ao_mpu6000_task, ao_mpu6000, "mpu6000");
+//     ao_add_task(&ao_mpu6000_task, ao_mpu6000, "mpu6000");
        ao_cmd_register(&ao_mpu6000_cmds[0]);
 }
 #endif
index caeda31fbbddff53d7715f4be07cab20d73bbfee..bace585336cca1235b3edeb3e05774cd1d9725d8 100644 (file)
@@ -308,7 +308,7 @@ struct ao_adc {
  * mpu6000
  */
 
-#define HAS_MPU6000            0
+#define HAS_MPU6000            1
 #define AO_MPU6000_INT_PORT    (&stm_gpioe)
 #define AO_MPU6000_INT_PIN     0
 #define AO_MPU6000_SPI_BUS     AO_SPI_1_PE13_PE14_PE15