Skip to content

Commit 2bd8277

Browse files
authored
fix(cli): Fix deprecation warning (#367)
* Update usb/uart vfs drivers to use latest, fixing deprecation warning Keeps the code up to date, using latest and removes all warnings from builds. Build and run `ble_gatt_server/example` (which uses CLI) on QtPy ESP32s3.
1 parent c324c45 commit 2bd8277

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

components/cli/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ endif()
99
idf_component_register(
1010
INCLUDE_DIRS ${CLI_INCLUDES}
1111
SRC_DIRS "src"
12-
REQUIRES driver vfs logger)
12+
REQUIRES driver esp_driver_uart esp_driver_usb_serial_jtag vfs logger)

components/cli/include/cli.hpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
#define __linux__
99

1010
#include "driver/uart.h"
11+
#include "driver/uart_vfs.h"
1112
#include "driver/usb_serial_jtag.h"
13+
#include "driver/usb_serial_jtag_vfs.h"
1214
#include "esp_err.h"
1315
#include "esp_system.h"
16+
1417
#include "esp_vfs_dev.h"
1518
#include "esp_vfs_usb_serial_jtag.h"
1619

@@ -135,11 +138,11 @@ class Cli : private cli::CliSession {
135138
ESP_ERROR_CHECK(uart_driver_install(port, 256, 0, 0, NULL, 0));
136139
ESP_ERROR_CHECK(uart_param_config(port, &uart_config));
137140
/* Tell VFS to use UART driver */
138-
esp_vfs_dev_uart_use_driver(port);
141+
uart_vfs_dev_use_driver(port);
139142
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
140-
esp_vfs_dev_uart_port_set_rx_line_endings(port, ESP_LINE_ENDINGS_CR);
143+
uart_vfs_dev_port_set_rx_line_endings(port, ESP_LINE_ENDINGS_CR);
141144
/* Move the caret to the beginning of the next line on '\n' */
142-
esp_vfs_dev_uart_port_set_tx_line_endings(port, ESP_LINE_ENDINGS_CRLF);
145+
uart_vfs_dev_port_set_tx_line_endings(port, ESP_LINE_ENDINGS_CRLF);
143146

144147
fflush(stdout);
145148
fsync(fileno(stdout));
@@ -171,9 +174,9 @@ class Cli : private cli::CliSession {
171174

172175
usb_serial_jtag_driver_config_t cfg = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
173176
usb_serial_jtag_driver_install(&cfg);
174-
esp_vfs_usb_serial_jtag_use_driver();
175-
esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
176-
esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
177+
usb_serial_jtag_vfs_use_driver();
178+
usb_serial_jtag_vfs_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
179+
usb_serial_jtag_vfs_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
177180

178181
fflush(stdout);
179182
fsync(fileno(stdout));

0 commit comments

Comments
 (0)