7#include <zephyr/device.h>
8#include <zephyr/drivers/uart.h>
9#include <zephyr/usb/usb_device.h>
13static const char *
const TAG =
"logger";
15#ifdef USE_LOGGER_USB_CDC
20 static bool opened =
false;
22 uart_line_ctrl_get(this->
uart_dev_, UART_LINE_CTRL_DTR, &dtr);
38 static const struct device *uart_dev =
nullptr;
39 switch (this->
uart_) {
41 uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart0));
44 uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(uart1));
46#ifdef USE_LOGGER_USB_CDC
48 uart_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(cdc_acm_uart0));
49 if (device_is_ready(uart_dev)) {
55 if (!device_is_ready(uart_dev)) {
62 ESP_LOGI(TAG,
"Log initialized");
80 switch (this->
uart_) {
82 return LOG_STR(
"UART0");
84 return LOG_STR(
"UART1");
85#ifdef USE_LOGGER_USB_CDC
87 return LOG_STR(
"USB_CDC");
90 return LOG_STR(
"UNKNOWN");
void schedule_dump_config()
const LogString * get_uart_selection_()
void pre_setup()
Set up this component.
void write_msg_(const char *msg)
Application App
Global storage of Application pointer - only one Application can exist.