Browse Source

fixed MPU6050 sig stuff, d'oh

added sensor axis orientation stuff to cli... not the most optimal way but surely one that uses least code, lol!

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@228 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
master
timecop@gmail.com 12 years ago
parent
commit
9fc43d5357
  1. 3468
      obj/baseflight.hex
  2. 9
      src/cli.c
  3. 3
      src/drv_mpu6050.c

3468
obj/baseflight.hex
File diff suppressed because it is too large
View File

9
src/cli.c

@ -139,6 +139,15 @@ const clivalue_t valueTable[] = {
{ "gimbal_roll_min", VAR_UINT16, &cfg.gimbal_roll_min, 100, 3000 },
{ "gimbal_roll_max", VAR_UINT16, &cfg.gimbal_roll_max, 100, 3000 },
{ "gimbal_roll_mid", VAR_UINT16, &cfg.gimbal_roll_mid, 100, 3000 },
{ "align_gyro_x", VAR_INT8, &cfg.align[ALIGN_GYRO][0], -3, 3 },
{ "align_gyro_y", VAR_INT8, &cfg.align[ALIGN_GYRO][1], -3, 3 },
{ "align_gyro_z", VAR_INT8, &cfg.align[ALIGN_GYRO][2], -3, 3 },
{ "align_acc_x", VAR_INT8, &cfg.align[ALIGN_ACCEL][0], -3, 3 },
{ "align_acc_y", VAR_INT8, &cfg.align[ALIGN_ACCEL][1], -3, 3 },
{ "align_acc_z", VAR_INT8, &cfg.align[ALIGN_ACCEL][2], -3, 3 },
{ "align_mag_x", VAR_INT8, &cfg.align[ALIGN_MAG][0], -3, 3 },
{ "align_mag_y", VAR_INT8, &cfg.align[ALIGN_MAG][1], -3, 3 },
{ "align_mag_z", VAR_INT8, &cfg.align[ALIGN_MAG][2], -3, 3 },
{ "acc_hardware", VAR_UINT8, &cfg.acc_hardware, 0, 3 },
{ "acc_lpf_factor", VAR_UINT8, &cfg.acc_lpf_factor, 0, 250 },
{ "acc_lpf_for_velocity", VAR_UINT8, &cfg.acc_lpf_for_velocity, 1, 250 },

3
src/drv_mpu6050.c

@ -160,8 +160,7 @@ bool mpu6050Detect(sensor_t * acc, sensor_t * gyro, uint8_t scale)
// The contents of WHO_AM_I are the upper 6 bits of the MPU-60X0s 7-bit I2C address.
// The least significant bit of the MPU-60X0s I2C address is determined by the value of the AD0 pin. (we know that already).
// But here's the best part: The value of the AD0 pin is not reflected in this register.
sig &= 0x7e;
if (sig != MPU6050_ADDRESS)
if (sig != (MPU6050_ADDRESS & 0x7e))
return false;
// get chip revision + fake it if needed

Loading…
Cancel
Save