From 25a35e20a3ff981de965fac52f41b5f2c4f54a6b Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 20 Sep 2023 09:46:39 +0200 Subject: [PATCH] fix(modem): Fix vfs terminal not to reset read_cb() automatically This change is needed for the fs terminal to work correctly again, after merging 44bae24c78d15f8b0a028e3016d5043c1198fe01 which shifted responsibility of thread safety from a terminal to the DTE. (Before it was the terminal, which removed this callback safely when processing completed, and thus we had to check the callback return value). Not the DTE layers are responsible for thread safety and the return value indicates success/failure from processing. Also uses the default clock, the same way as UART terminal. --- components/esp_modem/include/vfs_resource/vfs_create.hpp | 2 +- components/esp_modem/src/esp_modem_term_fs.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/esp_modem/include/vfs_resource/vfs_create.hpp b/components/esp_modem/include/vfs_resource/vfs_create.hpp index 3f1a80a2c..7b075143b 100644 --- a/components/esp_modem/include/vfs_resource/vfs_create.hpp +++ b/components/esp_modem/include/vfs_resource/vfs_create.hpp @@ -14,7 +14,7 @@ .stop_bits = UART_STOP_BITS_1, \ .parity = UART_PARITY_DISABLE, \ .flow_control = ESP_MODEM_FLOW_CONTROL_NONE,\ - .source_clk = UART_SCLK_APB, \ + .source_clk = ESP_MODEM_DEFAULT_UART_CLK, \ .baud_rate = 115200, \ .tx_io_num = 25, \ .rx_io_num = 26, \ diff --git a/components/esp_modem/src/esp_modem_term_fs.cpp b/components/esp_modem/src/esp_modem_term_fs.cpp index fde9c40ce..1bbc06a46 100644 --- a/components/esp_modem/src/esp_modem_term_fs.cpp +++ b/components/esp_modem/src/esp_modem_term_fs.cpp @@ -122,9 +122,7 @@ void FdTerminal::task() } else { if (FD_ISSET(f.fd, &rfds)) { if (on_read_priv) { - if (on_read_priv(nullptr, 0)) { - on_read_priv = nullptr; - } + on_read_priv(nullptr, 0); } } }