fix(console): Fix build issues when CONFIG_ESP_CONSOLE_NONE is enabled

This commit fixes the following build issues when CONFIG_ESP_CONSOLE_NONE is
enabled:

- vfs_console.c will attempt to register a VFS entry for STDIO console even if
CONFIG_ESP_CONSOLE_NONE is enabled. This results in "undeclared `primary_path`"
error.
- esp_console_repl_chpi.c does not use "TAG" when CONFIG_ESP_CONSOLE_NONE is
enabled, leading to a "defined by not used" warning.

Closes https://github.com/espressif/esp-idf/issues/12984
pull/13294/head
Darian Leung 2024-02-27 19:38:21 +08:00
rodzic 4ddc947d1c
commit 4e4278477d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 8AC9127B487AA4EF
2 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -22,7 +22,9 @@
#include "console_private.h"
#if !CONFIG_ESP_CONSOLE_NONE
static const char *TAG = "console.repl";
#endif // !CONFIG_ESP_CONSOLE_NONE
#if CONFIG_ESP_CONSOLE_UART_DEFAULT || CONFIG_ESP_CONSOLE_UART_CUSTOM
static esp_err_t esp_console_repl_uart_delete(esp_console_repl_t *repl);

Wyświetl plik

@ -207,10 +207,12 @@ esp_err_t esp_vfs_console_register(void)
return err;
}
#endif
#if !CONFIG_ESP_CONSOLE_NONE
err = esp_vfs_register_common(primary_path, strlen(primary_path), primary_vfs, NULL, &primary_vfs_index);
if (err != ESP_OK) {
return err;
}
#endif // !CONFIG_ESP_CONSOLE_NONE
// Secondary register part.
#if CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG