Use UART for all other chips too

This commit is contained in:
okhsunrog 2024-09-23 04:00:46 +03:00
parent 7a9d6c82fa
commit 26b482f57c

View file

@ -190,7 +190,21 @@ void initialize_console(void) {
/* Disable buffering on stdin */ /* Disable buffering on stdin */
setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32C3
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
usb_serial_jtag_vfs_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
/* Move the caret to the beginning of the next line on '\n' */
usb_serial_jtag_vfs_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
usb_serial_jtag_driver_config_t usb_serial_jtag_config = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
/* Install USB-SERIAL-JTAG driver for interrupt-driven reads and writes */
ESP_ERROR_CHECK(usb_serial_jtag_driver_install(&usb_serial_jtag_config));
/* Asign vfs to JTAG */
usb_serial_jtag_vfs_use_driver();
#else
/* Set up UART for the console */ /* Set up UART for the console */
const uart_config_t uart_config = { const uart_config_t uart_config = {
.baud_rate = 115200, .baud_rate = 115200,
@ -207,20 +221,7 @@ void initialize_console(void) {
/* Asign VFS to UART */ /* Asign VFS to UART */
// uart_vfs_dev_use_driver(UART_NUM_0); // uart_vfs_dev_use_driver(UART_NUM_0);
uart_vfs_dev_use_driver(UART_NUM_0); uart_vfs_dev_use_driver(UART_NUM_0);
#elif CONFIG_IDF_TARGET_ESP32C3
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
usb_serial_jtag_vfs_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
/* Move the caret to the beginning of the next line on '\n' */
usb_serial_jtag_vfs_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
usb_serial_jtag_driver_config_t usb_serial_jtag_config = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
/* Install USB-SERIAL-JTAG driver for interrupt-driven reads and writes */
ESP_ERROR_CHECK(usb_serial_jtag_driver_install(&usb_serial_jtag_config));
/* Asign vfs to JTAG */
usb_serial_jtag_vfs_use_driver();
#endif #endif
/* Enable non-blocking mode on stdin and stdout */ /* Enable non-blocking mode on stdin and stdout */