aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/lsm303d/lsm303d.cpp
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2014-07-31 10:40:50 +1000
committerLorenz Meier <lm@inf.ethz.ch>2014-10-08 10:38:27 +0200
commit94574f1a58735547a72c65556a683335fdf7ffbd (patch)
tree67a3c5db94ec03e6511188bc10e0ccef8206543f /src/drivers/lsm303d/lsm303d.cpp
parent9290e7b7f2e9b7e2f75b9d52c15a0c7f2064c146 (diff)
downloadpx4-firmware-94574f1a58735547a72c65556a683335fdf7ffbd.tar.gz
px4-firmware-94574f1a58735547a72c65556a683335fdf7ffbd.tar.bz2
px4-firmware-94574f1a58735547a72c65556a683335fdf7ffbd.zip
lsm303d: don't use DRDY when not on internal SPI bus
external SPI bus does not have accel DRDY connected Conflicts: mavlink/include/mavlink/v1.0
Diffstat (limited to 'src/drivers/lsm303d/lsm303d.cpp')
-rw-r--r--src/drivers/lsm303d/lsm303d.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp
index 6880cf0f8..01c89192a 100644
--- a/src/drivers/lsm303d/lsm303d.cpp
+++ b/src/drivers/lsm303d/lsm303d.cpp
@@ -1519,8 +1519,10 @@ LSM303D::measure()
{
// if the accel doesn't have any data ready then re-schedule
// for 100 microseconds later. This ensures we don't double
- // read a value and then miss the next value
- if (stm32_gpioread(GPIO_EXTI_ACCEL_DRDY) == 0) {
+ // read a value and then miss the next value.
+ // Note that DRDY is not available when the lsm303d is
+ // connected on the external bus
+ if (_bus == PX4_SPI_BUS_SENSORS && stm32_gpioread(GPIO_EXTI_ACCEL_DRDY) == 0) {
perf_count(_accel_reschedules);
hrt_call_delay(&_accel_call, 100);
return;