mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
AP_InertialSensor: fixed frequency to 16 bit in LDM303D and L3GD20 drivers
This commit is contained in:
parent
c750cbebfb
commit
986b7bf894
@ -453,7 +453,7 @@ void AP_InertialSensor_L3GD20::disable_i2c(void)
|
||||
hal.scheduler->panic(PSTR("L3GD20: Unable to disable I2C"));
|
||||
}
|
||||
|
||||
uint8_t AP_InertialSensor_L3GD20::set_samplerate(uint8_t frequency)
|
||||
uint8_t AP_InertialSensor_L3GD20::set_samplerate(uint16_t frequency)
|
||||
{
|
||||
uint8_t bits = REG1_POWER_NORMAL | REG1_Z_ENABLE | REG1_Y_ENABLE | REG1_X_ENABLE;
|
||||
if (frequency == 0)
|
||||
|
@ -48,7 +48,7 @@ private:
|
||||
void _register_write_check(uint8_t reg, uint8_t val);
|
||||
bool _hardware_init(Sample_rate sample_rate);
|
||||
void disable_i2c(void);
|
||||
uint8_t set_samplerate(uint8_t frequency);
|
||||
uint8_t set_samplerate(uint16_t frequency);
|
||||
uint8_t set_range(uint8_t max_dps);
|
||||
|
||||
AP_HAL::SPIDeviceDriver *_spi;
|
||||
|
@ -585,7 +585,7 @@ uint8_t AP_InertialSensor_LSM303D::accel_set_range(uint8_t max_g)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t AP_InertialSensor_LSM303D::accel_set_samplerate(uint8_t frequency)
|
||||
uint8_t AP_InertialSensor_LSM303D::accel_set_samplerate(uint16_t frequency)
|
||||
{
|
||||
uint8_t setbits = 0;
|
||||
uint8_t clearbits = REG1_RATE_BITS_A;
|
||||
@ -692,7 +692,7 @@ uint8_t AP_InertialSensor_LSM303D::mag_set_range(uint8_t max_ga)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t AP_InertialSensor_LSM303D::mag_set_samplerate(uint8_t frequency)
|
||||
uint8_t AP_InertialSensor_LSM303D::mag_set_samplerate(uint16_t frequency)
|
||||
{
|
||||
uint8_t setbits = 0;
|
||||
uint8_t clearbits = REG5_RATE_BITS_M;
|
||||
|
@ -63,10 +63,10 @@ private:
|
||||
bool _hardware_init(Sample_rate sample_rate);
|
||||
void disable_i2c(void);
|
||||
uint8_t accel_set_range(uint8_t max_g);
|
||||
uint8_t accel_set_samplerate(uint8_t frequency);
|
||||
uint8_t accel_set_samplerate(uint16_t frequency);
|
||||
uint8_t accel_set_onchip_lowpass_filter_bandwidth(uint8_t bandwidth);
|
||||
uint8_t mag_set_range(uint8_t max_ga);
|
||||
uint8_t mag_set_samplerate(uint8_t frequency);
|
||||
uint8_t mag_set_samplerate(uint16_t frequency);
|
||||
|
||||
AP_HAL::SPIDeviceDriver *_spi;
|
||||
AP_HAL::Semaphore *_spi_sem;
|
||||
|
Loading…
Reference in New Issue
Block a user