diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-07 04:18:50 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-07 04:18:50 -0700 |
commit | 2569338919acda9b3bc64f4a02e2014f621980c4 (patch) | |
tree | f37004c2e6739367851f79359d41b4f82c7a90c1 /src | |
parent | 8a2a0019a43c07d698bb3f9e98430347acd8a0a6 (diff) | |
parent | 2de01964e2ca30344f64df69500775a4eb7af36d (diff) | |
download | px4-firmware-2569338919acda9b3bc64f4a02e2014f621980c4.tar.gz px4-firmware-2569338919acda9b3bc64f4a02e2014f621980c4.tar.bz2 px4-firmware-2569338919acda9b3bc64f4a02e2014f621980c4.zip |
Merge pull request #891 from Kynos/master
Reset MS5611 baro sensor after an error
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/ms5611/ms5611.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/ms5611/ms5611.cpp b/src/drivers/ms5611/ms5611.cpp index 0ef056273..3fe1b0abc 100644 --- a/src/drivers/ms5611/ms5611.cpp +++ b/src/drivers/ms5611/ms5611.cpp @@ -526,6 +526,7 @@ void MS5611::cycle() { int ret; + unsigned dummy; /* collection phase? */ if (_collect_phase) { @@ -542,6 +543,8 @@ MS5611::cycle() } else { //log("collection error %d", ret); } + /* issue a reset command to the sensor */ + _interface->ioctl(IOCTL_RESET, dummy); /* reset the collection state machine and try again */ start_cycle(); return; @@ -573,6 +576,8 @@ MS5611::cycle() ret = measure(); if (ret != OK) { //log("measure error %d", ret); + /* issue a reset command to the sensor */ + _interface->ioctl(IOCTL_RESET, dummy); /* reset the collection state machine and try again */ start_cycle(); return; |