From 26a28bfde78c8f1a2f1363390487ce8e5af917aa Mon Sep 17 00:00:00 2001 From: Geoff Lee Date: Tue, 21 Nov 2017 21:16:27 +0000 Subject: [PATCH] Fix reassignment of variable in pressure calculation algo --- library/bme680/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/bme680/__init__.py b/library/bme680/__init__.py index 9b85b51..c51d9dd 100644 --- a/library/bme680/__init__.py +++ b/library/bme680/__init__.py @@ -304,9 +304,9 @@ class BME680(BME680Data): self.calibration_data.par_p6) >> 2 var2 = var2 + ((var1 * self.calibration_data.par_p5) << 1) var2 = (var2 >> 2) + (self.calibration_data.par_p4 << 16) - - var1 = ((var1 >> 2) * (var1 >> 2)) >> 13 - var1 = ((var1 * (self.calibration_data.par_p3 << 5)) >> 3) + ((self.calibration_data.par_p2 * var1) >> 1) + var1 = (((((var1 >> 2) * (var1 >> 2)) >> 13 ) * + ((self.calibration_data.par_p3 << 5)) >> 3) + + ((self.calibration_data.par_p2 * var1) >> 1)) var1 = var1 >> 18 var1 = ((32768 + var1) * self.calibration_data.par_p1) >> 15