Fix bad merge for UART

This commit is contained in:
Otto Winter 2020-07-26 22:48:50 +02:00
parent 2092939353
commit 9c0e463698
No known key found for this signature in database
GPG key ID: 48ED2DDB96D7682C

View file

@ -61,7 +61,6 @@ void UARTDevice::check_uart_settings(uint32_t baud_rate, uint8_t stop_bits, UART
ESP_LOGE(TAG, " Invalid parity: Integration requested parity %s but you have %s!", parity_to_str(parity), ESP_LOGE(TAG, " Invalid parity: Integration requested parity %s but you have %s!", parity_to_str(parity),
parity_to_str(this->parent_->parity_)); parity_to_str(this->parent_->parity_));
} }
this->stop_bits_ = stop_bits;
} }
const char *parity_to_str(UARTParityOptions parity) { const char *parity_to_str(UARTParityOptions parity) {
@ -77,16 +76,5 @@ const char *parity_to_str(UARTParityOptions parity) {
} }
} }
void UARTDevice::check_uart_settings(uint32_t baud_rate, uint8_t stop_bits) {
if (this->parent_->baud_rate_ != baud_rate) {
ESP_LOGE(TAG, " Invalid baud_rate: Integration requested baud_rate %u but you have %u!", baud_rate,
this->parent_->baud_rate_);
}
if (this->parent_->stop_bits_ != stop_bits) {
ESP_LOGE(TAG, " Invalid stop bits: Integration requested stop_bits %u but you have %u!", stop_bits,
this->parent_->stop_bits_);
}
}
} // namespace uart } // namespace uart
} // namespace esphome } // namespace esphome