Browse Source

Fix void return on BMX280 sensor (#489)

softuart
Xose Pérez 6 years ago
parent
commit
13f8517b25
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      README.md
  2. +1
    -1
      code/espurna/sensors/BMX280Sensor.h

+ 2
- 2
README.md View File

@ -4,8 +4,8 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8266 based smart switch
It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries. It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries.
[![version](https://img.shields.io/badge/version-1.12.3-brightgreen.svg)](CHANGELOG.md) [![version](https://img.shields.io/badge/version-1.12.3-brightgreen.svg)](CHANGELOG.md)
![branch](https://img.shields.io/badge/branch-master-orange.svg)
[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=master)](https://travis-ci.org/xoseperez/espurna)
![branch](https://img.shields.io/badge/branch-dev-orange.svg)
[![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna)
[![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE) [![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE)
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=xose%2eperez%40gmail%2ecom&lc=US&no_note=0&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest) [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=xose%2eperez%40gmail%2ecom&lc=US&no_note=0&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest)
[![twitter](https://img.shields.io/twitter/follow/xoseperez.svg?style=social)](https://twitter.com/intent/follow?screen_name=xoseperez) [![twitter](https://img.shields.io/twitter/follow/xoseperez.svg?style=social)](https://twitter.com/intent/follow?screen_name=xoseperez)


+ 1
- 1
code/espurna/sensors/BMX280Sensor.h View File

@ -341,7 +341,7 @@ class BMX280Sensor : public I2CSensor {
var1 = ((var1 * var1 * (int64_t)_bmx280_calib.dig_P3)>>8) + var1 = ((var1 * var1 * (int64_t)_bmx280_calib.dig_P3)>>8) +
((var1 * (int64_t)_bmx280_calib.dig_P2)<<12); ((var1 * (int64_t)_bmx280_calib.dig_P2)<<12);
var1 = (((((int64_t)1)<<47)+var1))*((int64_t)_bmx280_calib.dig_P1)>>33; var1 = (((((int64_t)1)<<47)+var1))*((int64_t)_bmx280_calib.dig_P1)>>33;
if (var1 == 0) return; // avoid exception caused by division by zero
if (var1 == 0) return SENSOR_ERROR_I2C; // avoid exception caused by division by zero
p = 1048576 - adc_P; p = 1048576 - adc_P;
p = (((p<<31) - var2)*3125) / var1; p = (((p<<31) - var2)*3125) / var1;


Loading…
Cancel
Save