forked from espressif/arduino-esp32
Improve CDC Logging support
This commit is contained in:
@ -132,7 +132,7 @@ void HardwareSerial::setDebugOutput(bool en)
|
|||||||
uartSetDebug(_uart);
|
uartSetDebug(_uart);
|
||||||
} else {
|
} else {
|
||||||
if(uartGetDebug() == _uart_nr) {
|
if(uartGetDebug() == _uart_nr) {
|
||||||
uartSetDebug(0);
|
uartSetDebug(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -315,6 +315,7 @@ uint32_t USBCDC::baudRate()
|
|||||||
void USBCDC::setDebugOutput(bool en)
|
void USBCDC::setDebugOutput(bool en)
|
||||||
{
|
{
|
||||||
if(en) {
|
if(en) {
|
||||||
|
uartSetDebug(NULL);
|
||||||
ets_install_putc1((void (*)(char)) &cdc0_write_char);
|
ets_install_putc1((void (*)(char)) &cdc0_write_char);
|
||||||
} else {
|
} else {
|
||||||
ets_install_putc1(NULL);
|
ets_install_putc1(NULL);
|
||||||
|
@ -75,7 +75,7 @@ const char * pathToFileName(const char * path);
|
|||||||
int log_printf(const char *fmt, ...);
|
int log_printf(const char *fmt, ...);
|
||||||
|
|
||||||
#define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter format ARDUHAL_LOG_RESET_COLOR "\r\n"
|
#define ARDUHAL_SHORT_LOG_FORMAT(letter, format) ARDUHAL_LOG_COLOR_ ## letter format ARDUHAL_LOG_RESET_COLOR "\r\n"
|
||||||
#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__
|
#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__
|
||||||
|
|
||||||
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
|
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
|
||||||
#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__)
|
#define log_v(format, ...) log_printf(ARDUHAL_LOG_FORMAT(V, format), ##__VA_ARGS__)
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user