Skip to content

Commit 83f78c2

Browse files
committed
Improve CDC Logging support
1 parent c648b03 commit 83f78c2

File tree

7 files changed

+5
-2
lines changed

7 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ set(CORE_SRCS
3333
cores/esp32/stdlib_noniso.c
3434
cores/esp32/Stream.cpp
3535
cores/esp32/StreamString.cpp
36+
cores/esp32/USB.cpp
37+
cores/esp32/USBCDC.cpp
3638
cores/esp32/wiring_pulse.c
3739
cores/esp32/wiring_shift.c
3840
cores/esp32/WMath.cpp

cores/esp32/HardwareSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void HardwareSerial::setDebugOutput(bool en)
132132
uartSetDebug(_uart);
133133
} else {
134134
if(uartGetDebug() == _uart_nr) {
135-
uartSetDebug(0);
135+
uartSetDebug(NULL);
136136
}
137137
}
138138
}

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
@@ -80,7 +80,7 @@ const char * pathToFileName(const char * path);
8080
int log_printf(const char *fmt, ...);
8181

8282
#define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter format ARDUHAL_LOG_RESET_COLOR "\r\n"
83-
#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__
83+
#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__
8484

8585
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
8686
#ifndef USE_ESP_IDF_LOG

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)