1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-25 06:32:22 +01:00

Fix logger uart conflict check (#858)

* Fix logger uart conflict check

* Fix class for check func

* Fix syntax

Hope lint is OK with moving the end of the conditional outside the #IFDEF

* Move end of conditional inside ifdef and remove extra whitespace

* Simplify

clang-format did not like the ifdefs and was reformatting in a way that killed clang-tidy.

Simple solution is to use logger's hw_serial as source of truth

Also simplifies the code - uart doesn't need to know what the logger uart settings mean
This commit is contained in:
Brandon Davidson
2019-11-14 04:36:55 -08:00
committed by Otto Winter
parent 694395ac91
commit aca306d120
3 changed files with 17 additions and 13 deletions

View File

@@ -32,6 +32,7 @@ class Logger : public Component {
/// Manually set the baud rate for serial, set to 0 to disable.
void set_baud_rate(uint32_t baud_rate);
uint32_t get_baud_rate() const { return baud_rate_; }
HardwareSerial *get_hw_serial() const { return hw_serial_; }
/// Get the UART used by the logger.
UARTSelection get_uart() const;