From b36845330e7291b4a84a8ee749a1a98a692a15c4 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 1 Jun 2020 11:31:55 -0400 Subject: [PATCH] ms5611: prevent starting as ms5607 type on ms5611 hardware - an ms5611 using the ms5607 calculations will return impossibly high barometric pressure (~2000 mbar) --- src/drivers/barometer/ms5611/ms5611.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/barometer/ms5611/ms5611.cpp b/src/drivers/barometer/ms5611/ms5611.cpp index 49d5b8bada..c44b2ac2fe 100644 --- a/src/drivers/barometer/ms5611/ms5611.cpp +++ b/src/drivers/barometer/ms5611/ms5611.cpp @@ -107,6 +107,11 @@ MS5611::init() /* This is likely not this device, abort */ ret = -EINVAL; break; + + } else if (brp.pressure > 1500.0f) { + /* This is likely not this device, abort */ + ret = -EINVAL; + break; } }