diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-05 21:08:19 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-05 21:08:19 +0200 |
commit | cfd737aa734f9b0cd97f79148d6b959978b2cad0 (patch) | |
tree | a94d54623842236a5b2c50361ab1875ae2e3ccd6 | |
parent | a2f923b9a3bf403e3a9fcee39d87c7aecc28559d (diff) | |
download | px4-firmware-cfd737aa734f9b0cd97f79148d6b959978b2cad0.tar.gz px4-firmware-cfd737aa734f9b0cd97f79148d6b959978b2cad0.tar.bz2 px4-firmware-cfd737aa734f9b0cd97f79148d6b959978b2cad0.zip |
Made sensors startup routine more flexible
-rw-r--r-- | src/modules/sensors/sensors.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 5dc23f5c1..f7b41b120 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -801,11 +801,13 @@ Sensors::gyro_init() #ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 - /* set the gyro internal sampling rate up to at leat 500Hz */ - ioctl(fd, GYROIOCSSAMPLERATE, 500); + /* set the gyro internal sampling rate up to at least 1000Hz */ + if (ioctl(fd, GYROIOCSSAMPLERATE, 1000) != OK) + ioctl(fd, GYROIOCSSAMPLERATE, 800); - /* set the driver to poll at 500Hz */ - ioctl(fd, SENSORIOCSPOLLRATE, 500); + /* set the driver to poll at 1000Hz */ + if (ioctl(fd, SENSORIOCSPOLLRATE, 1000) != OK) + ioctl(fd, SENSORIOCSPOLLRATE, 800); #else |