27#include "driver/uart.h"
52 uint32_t result =
static_cast<uint32_t
>(DEC);
53 bool in_range = ((
static_cast<uint32_t
>(base) >=
NUM_BASE_MIN) &&
56 result =
static_cast<uint32_t
>(base);
64 size_t len = strlen(str);
88 (void)fputs(&buf[pos], stdout);
97 uart_config_t cfg = {};
98 cfg.baud_rate =
static_cast<int>(baudRate);
99 cfg.data_bits = UART_DATA_8_BITS;
100 cfg.parity = UART_PARITY_DISABLE;
101 cfg.stop_bits = UART_STOP_BITS_1;
102 cfg.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
104 cfg.source_clk = UART_SCLK_DEFAULT;
129 (void)fputc(
static_cast<int>(c), stdout);
161 bool is_negative_decimal = ((value < 0) && (safe_base == static_cast<uint32_t>(DEC)));
162 if (is_negative_decimal) {
163 (void)fputc(
static_cast<int>(
'-'), stdout);
165 uint32_t abs_val = (~static_cast<uint32_t>(value)) + 1U;
static const char HEX_CHARS[]
static const uart_port_t UART_LOG_PORT
static const size_t ELEMENT_SIZE
static uint32_t clamp_base(int base)
static const uint32_t NUM_BASE_MAX
static const uint32_t NUM_BUF_SIZE
static void uart_write_str(const char *str)
static void write_uint_to_uart(uint32_t value, uint32_t base)
static const char LOGGER_NEWLINE[]
static const uint32_t NUM_BASE_MIN
static const uint8_t UART_RX_FLOW_THRESH_NONE
CW_Logger implementation that writes to ESP32 UART0 via printf.
bool begin(unsigned long baudRate=115200UL) override
Initialise UART0 at the given baud rate.
void println() override
Print a CR+LF newline sequence.
bool m_initialized
true after a successful begin call.
void print(const __FlashStringHelper *str) override
Print a PROGMEM string.