06-26-2019 02:14 PM
Consider this as issue to https://github.com/BoschSensortec/BMP280_driver
This driver sets t_fine when calibrated temperature is calculated e.g. https://github.com/BoschSensortec/BMP280_driver/blob/master/bmp280.c#L485
And this t_fine is then used to calculate calibrated pressure e.g. in here https://github.com/BoschSensortec/BMP280_driver/blob/master/bmp280.c#L510
t_fine is not initialized inside the driver (nor it is initialized in the example usage either https://github.com/BoschSensortec/BMP280_driver/blob/master/examples/pressure.c#L18)
This means that driver uses random data to calculate pressure if you don't have brains to initialize the struct correctly by yourself(guess if I fall into this gategory) or you don't call the *get_comp_temp* functions before calling *get_comp_pressure*(yep, here too).
IMHO:
- Fix the example to initialize struct(dunno if 0 is then good value to t_fine?)
- Should the t_fine be calculated in here for example? https://github.com/BoschSensortec/BMP280_driver/blob/master/bmp280.c#L435
06-26-2019 05:02 PM