diff options
author | Lorenz Meier <lm@qgroundcontrol.org> | 2014-10-28 11:10:41 +0100 |
---|---|---|
committer | Lorenz Meier <lm@qgroundcontrol.org> | 2014-10-28 11:10:41 +0100 |
commit | 1ff9e4d665d6333f3ee96c2e964ae42224d8a88a (patch) | |
tree | aa184439ab5e27ed7c9e99499191ef0b2a52b2cd /src | |
parent | 5a77b7a357cea1ab70aaf8ab35ba213eeae33231 (diff) | |
parent | ae29d04ff5dc1d3d9c48b081846f04ad34e44373 (diff) | |
download | px4-firmware-1ff9e4d665d6333f3ee96c2e964ae42224d8a88a.tar.gz px4-firmware-1ff9e4d665d6333f3ee96c2e964ae42224d8a88a.tar.bz2 px4-firmware-1ff9e4d665d6333f3ee96c2e964ae42224d8a88a.zip |
Merge pull request #1407 from tridge/pullrequest-px4flow-probe
px4flow: try a 22 byte transfer in probe()
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/px4flow/px4flow.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/px4flow/px4flow.cpp b/src/drivers/px4flow/px4flow.cpp index 60ad3c1af..04aba9eae 100644 --- a/src/drivers/px4flow/px4flow.cpp +++ b/src/drivers/px4flow/px4flow.cpp @@ -249,6 +249,17 @@ out: int PX4FLOW::probe() { + uint8_t val[22]; + + // to be sure this is not a ll40ls Lidar (which can also be on + // 0x42) we check if a 22 byte transfer works from address + // 0. The ll40ls gives an error for that, whereas the flow + // happily returns some data + if (transfer(nullptr, 0, &val[0], 22) != OK) { + return -EIO; + } + + // that worked, so start a measurement cycle return measure(); } |