BME280: fix typos, use forced mode constant (#974)

* Fix typo in BME280 chip ID error message

* Use BME280 forced mode constant instead of literal
This commit is contained in:
Jelle Raaijmakers 2020-02-08 18:10:07 +01:00 committed by GitHub
parent e6f21873c3
commit 7721049ed7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,7 +146,7 @@ void BME280Component::dump_config() {
ESP_LOGE(TAG, "Communication with BME280 failed!"); ESP_LOGE(TAG, "Communication with BME280 failed!");
break; break;
case WRONG_CHIP_ID: case WRONG_CHIP_ID:
ESP_LOGE(TAG, "BMP280 has wrong chip ID! Is it a BMP280?"); ESP_LOGE(TAG, "BME280 has wrong chip ID! Is it a BME280?");
break; break;
case NONE: case NONE:
default: default:
@ -172,7 +172,7 @@ void BME280Component::update() {
uint8_t meas_register = 0; uint8_t meas_register = 0;
meas_register |= (this->temperature_oversampling_ & 0b111) << 5; meas_register |= (this->temperature_oversampling_ & 0b111) << 5;
meas_register |= (this->pressure_oversampling_ & 0b111) << 2; meas_register |= (this->pressure_oversampling_ & 0b111) << 2;
meas_register |= 0b01; // Forced mode meas_register |= BME280_MODE_FORCED;
if (!this->write_byte(BME280_REGISTER_CONTROL, meas_register)) { if (!this->write_byte(BME280_REGISTER_CONTROL, meas_register)) {
this->status_set_warning(); this->status_set_warning();
return; return;