refactor(examples/console): Warn if secondary console is active

Having a secondary serial console is not useful when applications
use a REPL console type, hence we warn for it in examples.

Closes https://github.com/espressif/esp-idf/issues/11731
This commit is contained in:
Jakob Hasse
2023-06-29 12:09:23 +08:00
parent bce88908c7
commit 197e919d74
8 changed files with 48 additions and 0 deletions

View File

@@ -20,6 +20,17 @@
#include "cmd_wifi.h"
#include "cmd_nvs.h"
/*
* We warn if a secondary serial console is enabled. A secondary serial console is always output-only and
* hence not very useful for interactive console applications. If you encounter this warning, consider disabling
* the secondary serial console in menuconfig unless you know what you are doing.
*/
#if SOC_USB_SERIAL_JTAG_SUPPORTED
#if !CONFIG_ESP_CONSOLE_SECONDARY_NONE
#warning "A secondary serial console is not useful when using the console component. Please disable it in menuconfig."
#endif
#endif
static const char* TAG = "example";
#define PROMPT_STR CONFIG_IDF_TARGET