diff options
author | Kynos <mail01@delago.net> | 2014-05-02 22:00:34 +0200 |
---|---|---|
committer | Kynos <mail01@delago.net> | 2014-05-02 22:00:34 +0200 |
commit | 2de01964e2ca30344f64df69500775a4eb7af36d (patch) | |
tree | 00d1d8777401187aa67124e574123de017f36142 /src | |
parent | 5e9639ad9bea4db26ee74e5f0c3c585a75c492a1 (diff) | |
download | px4-firmware-2de01964e2ca30344f64df69500775a4eb7af36d.tar.gz px4-firmware-2de01964e2ca30344f64df69500775a4eb7af36d.tar.bz2 px4-firmware-2de01964e2ca30344f64df69500775a4eb7af36d.zip |
Reset MS5611 baro sensor after an error
Reset MS5611 baro sensor after an error in order to avoid endless error
loops
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; |