mirror of
https://github.com/esphome/esphome.git
synced 2024-12-27 07:51:43 +01:00
fix clang
This commit is contained in:
parent
1e552bb458
commit
8d8939eaf4
1 changed files with 4 additions and 0 deletions
|
@ -13,6 +13,7 @@ namespace logger {
|
|||
|
||||
static const char *const TAG = "logger";
|
||||
|
||||
#ifdef USE_LOGGER_USB_CDC
|
||||
void Logger::loop() {
|
||||
if (this->uart_ != UART_SELECTION_USB_CDC || nullptr == this->uart_dev_) {
|
||||
return;
|
||||
|
@ -31,6 +32,7 @@ void Logger::loop() {
|
|||
}
|
||||
opened = !opened;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Logger::pre_setup() {
|
||||
if (this->baud_rate_ > 0) {
|
||||
|
@ -42,12 +44,14 @@ void Logger::pre_setup() {
|
|||
case UART_SELECTION_UART1:
|
||||
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart1));
|
||||
break;
|
||||
#ifdef USE_LOGGER_USB_CDC
|
||||
case UART_SELECTION_USB_CDC:
|
||||
uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(cdc_acm_uart0));
|
||||
if (device_is_ready(uart_dev)) {
|
||||
usb_enable(nullptr);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
if (!device_is_ready(uart_dev)) {
|
||||
ESP_LOGE(TAG, "%s is not ready.", get_uart_selection_());
|
||||
|
|
Loading…
Reference in a new issue