crazyflie: removed crazyflie specific #ifdefs from mpu9250

This commit is contained in:
DanielePettenuzzo
2018-05-14 13:32:30 +02:00
committed by Beat Küng
parent f49fd2acc7
commit ffbb53454e
2 changed files with 10 additions and 9 deletions
+8 -7
View File
@@ -139,11 +139,12 @@ MPU9250::MPU9250(device::Device *interface, device::Device *mag_interface, const
_gyro_range_scale(0.0f),
_gyro_range_rad_s(0.0f),
_dlpf_freq(MPU9250_DEFAULT_ONCHIP_FILTER_FREQ),
#ifdef CRAZYFLIE
// #ifdef CRAZYFLIE
// _sample_rate(250),
// #else
// _sample_rate(1000),
// #endif
_sample_rate(250),
#else
_sample_rate(1000),
#endif
_accel_reads(perf_alloc(PC_COUNT, "mpu9250_acc_read")),
_gyro_reads(perf_alloc(PC_COUNT, "mpu9250_gyro_read")),
_sample_perf(perf_alloc(PC_ELAPSED, "mpu9250_read")),
@@ -160,8 +161,8 @@ MPU9250::MPU9250(device::Device *interface, device::Device *mag_interface, const
_gyro_filter_x(MPU9250_GYRO_DEFAULT_RATE, MPU9250_GYRO_DEFAULT_DRIVER_FILTER_FREQ),
_gyro_filter_y(MPU9250_GYRO_DEFAULT_RATE, MPU9250_GYRO_DEFAULT_DRIVER_FILTER_FREQ),
_gyro_filter_z(MPU9250_GYRO_DEFAULT_RATE, MPU9250_GYRO_DEFAULT_DRIVER_FILTER_FREQ),
_accel_int(1000000 / MPU9250_ACCEL_MAX_OUTPUT_RATE / 2),
_gyro_int(1000000 / MPU9250_GYRO_MAX_OUTPUT_RATE / 2, true),
_accel_int(1000000 / MPU9250_ACCEL_MAX_OUTPUT_RATE / 4),
_gyro_int(1000000 / MPU9250_GYRO_MAX_OUTPUT_RATE / 4, true),
_rotation(rotation),
_checked_next(0),
_last_temperature(0),
@@ -1161,7 +1162,7 @@ MPU9250::cycle()
&_work,
(worker_t)&MPU9250::cycle_trampoline,
this,
USEC2TICK(900));
USEC2TICK(_call_interval - MPU9250_TIMER_REDUCTION));
}
}
#endif
+2 -2
View File
@@ -182,11 +182,11 @@
#define MPU9250_ACCEL_DEFAULT_RATE 1000
// #ifdef CRAZYFLIE
// #define MPU9250_ACCEL_MAX_OUTPUT_RATE 3*280
// #define MPU9250_ACCEL_MAX_OUTPUT_RATE 4*280
// #else
// #define MPU9250_ACCEL_MAX_OUTPUT_RATE 280
// #endif
#define MPU9250_ACCEL_MAX_OUTPUT_RATE 280
#define MPU9250_ACCEL_MAX_OUTPUT_RATE 280 // remove this when using the previous #ifdef
#define MPU9250_ACCEL_DEFAULT_DRIVER_FILTER_FREQ 30
#define MPU9250_GYRO_DEFAULT_RATE 1000
/* rates need to be the same between accel and gyro */