From 4e59b8d24a4dd23459de0265f8903ef1272a7083 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 31 Jul 2019 10:30:50 +1000 Subject: [PATCH] AP_Baro: check for all 1 ADC read on MS5611 --- libraries/AP_Baro/AP_Baro_MS5611.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Baro/AP_Baro_MS5611.cpp b/libraries/AP_Baro/AP_Baro_MS5611.cpp index 2b84cb8397..013a06539f 100644 --- a/libraries/AP_Baro/AP_Baro_MS5611.cpp +++ b/libraries/AP_Baro/AP_Baro_MS5611.cpp @@ -291,9 +291,10 @@ void AP_Baro_MS56XX::_timer(void) } /* if we had a failed read we are all done */ - if (adc_val == 0) { + if (adc_val == 0 || adc_val == 0xFFFFFF) { // a failed read can mean the next returned value will be - // corrupt, we must discard it + // corrupt, we must discard it. This copes with MISO being + // pulled either high or low _discard_next = true; return; }