increased boolean readability

This commit is contained in:
minomy13 2024-11-13 18:27:47 +01:00
parent f3ec1ed43a
commit 27c8793976
No known key found for this signature in database

View file

@ -24,7 +24,7 @@ void DHT::dump_config() {
ESP_LOGCONFIG(TAG, " Model: DHT22 (or equivalent)"); ESP_LOGCONFIG(TAG, " Model: DHT22 (or equivalent)");
} }
if (this->use_internal_pullup_ == true) { if (this->use_internal_pullup_) {
ESP_LOGCONFIG(TAG, " Internal pull-up resistor enabled."); ESP_LOGCONFIG(TAG, " Internal pull-up resistor enabled.");
} else { } else {
ESP_LOGCONFIG(TAG, " Internal pull-up resistor disabled."); ESP_LOGCONFIG(TAG, " Internal pull-up resistor disabled.");
@ -108,7 +108,7 @@ bool HOT IRAM_ATTR DHT::read_sensor_(float *temperature, float *humidity, bool r
delayMicroseconds(800); delayMicroseconds(800);
} }
if (this->use_internal_pullup_ == true) { if (this->use_internal_pullup_) {
this->pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP); this->pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
} else { } else {
this->pin_->pin_mode(gpio::FLAG_INPUT); this->pin_->pin_mode(gpio::FLAG_INPUT);