Skip to content

Commit 4fa3cba

Browse files
committed
Improve CDC Logging support
1 parent 280bf4d commit 4fa3cba

File tree

6 files changed

+3
-2
lines changed

6 files changed

+3
-2
lines changed

cores/esp32/HardwareSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void HardwareSerial::setDebugOutput(bool en)
127127
uartSetDebug(_uart);
128128
} else {
129129
if(uartGetDebug() == _uart_nr) {
130-
uartSetDebug(0);
130+
uartSetDebug(NULL);
131131
}
132132
}
133133
}

cores/esp32/USBCDC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ uint32_t USBCDC::baudRate()
315315
void USBCDC::setDebugOutput(bool en)
316316
{
317317
if(en) {
318+
uartSetDebug(NULL);
318319
ets_install_putc1((void (*)(char)) &cdc0_write_char);
319320
} else {
320321
ets_install_putc1(NULL);

cores/esp32/esp32-hal-log.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const char * pathToFileName(const char * path);
7575
int log_printf(const char *fmt, ...);
7676

7777
#define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter format ARDUHAL_LOG_RESET_COLOR "\r\n"
78-
#define ARDUHAL_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter "[" #letter "][%s:%u] %s(): " format ARDUHAL_LOG_RESET_COLOR "\r\n", pathToFileName(__FILE__), __LINE__, __FUNCTION__
78+
#define ARDUHAL_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter "[%6u][" #letter "][%s:%u] %s(): " format ARDUHAL_LOG_RESET_COLOR "\r\n", (unsigned long) (esp_timer_get_time() / 1000ULL), pathToFileName(__FILE__), __LINE__, __FUNCTION__
7979

8080
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
8181
#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__)

tools/sdk/esp32s2/lib/libsoc.a

-1.29 KB
Binary file not shown.
0 Bytes
Binary file not shown.

tools/sdk/esp32s2/lib/libtinyusb.a

-3.11 KB
Binary file not shown.

0 commit comments

Comments
 (0)