mirror of
https://github.com/esphome/esphome.git
synced 2024-11-04 09:01:53 +01:00
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:
parent
e6f21873c3
commit
7721049ed7
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user