1
0
mirror of https://github.com/cmur2/python-bme680.git synced 2024-12-22 12:54:29 +01:00

Fix reassignment of variable in pressure calculation algo

This commit is contained in:
Geoff Lee 2017-11-21 21:16:27 +00:00
parent 1baa47fb56
commit 26a28bfde7

View File

@ -304,9 +304,9 @@ class BME680(BME680Data):
self.calibration_data.par_p6) >> 2 self.calibration_data.par_p6) >> 2
var2 = var2 + ((var1 * self.calibration_data.par_p5) << 1) var2 = var2 + ((var1 * self.calibration_data.par_p5) << 1)
var2 = (var2 >> 2) + (self.calibration_data.par_p4 << 16) var2 = (var2 >> 2) + (self.calibration_data.par_p4 << 16)
var1 = (((((var1 >> 2) * (var1 >> 2)) >> 13 ) *
var1 = ((var1 >> 2) * (var1 >> 2)) >> 13 ((self.calibration_data.par_p3 << 5)) >> 3) +
var1 = ((var1 * (self.calibration_data.par_p3 << 5)) >> 3) + ((self.calibration_data.par_p2 * var1) >> 1) ((self.calibration_data.par_p2 * var1) >> 1))
var1 = var1 >> 18 var1 = var1 >> 18
var1 = ((32768 + var1) * self.calibration_data.par_p1) >> 15 var1 = ((32768 + var1) * self.calibration_data.par_p1) >> 15