From 25a35e20a3ff981de965fac52f41b5f2c4f54a6b Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 20 Sep 2023 09:46:39 +0200 Subject: [PATCH 1/3] 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); } } } From 5287432197b46a302d62f243cfe095186b197add Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 20 Sep 2023 10:46:53 +0200 Subject: [PATCH 2/3] fix(modem): Fix netif to set PPP config in C++ way If the config struct contains more items (or more items will be added in future) this init will not compile cleanly --- components/esp_modem/src/esp_modem_netif.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_modem/src/esp_modem_netif.cpp b/components/esp_modem/src/esp_modem_netif.cpp index 3027179fa..65bddb43b 100644 --- a/components/esp_modem/src/esp_modem_netif.cpp +++ b/components/esp_modem/src/esp_modem_netif.cpp @@ -49,9 +49,9 @@ esp_err_t Netif::esp_modem_post_attach(esp_netif_t *esp_netif, void *args) ESP_ERROR_CHECK(esp_netif_set_driver_config(esp_netif, &driver_ifconfig)); // check if PPP error events are enabled, if not, do enable the error occurred/state changed // to notify the modem layer when switching modes - esp_netif_ppp_config_t ppp_config = { .ppp_phase_event_enabled = true, // assuming phase enabled, as earlier IDFs - .ppp_error_event_enabled = false - }; // don't provide cfg getters so we enable both events + esp_netif_ppp_config_t ppp_config = { }; + ppp_config.ppp_phase_event_enabled = true; // assuming phase enabled, as earlier IDFs + ppp_config.ppp_error_event_enabled = false; // don't provide cfg getters so we enable both events #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) esp_netif_ppp_get_params(esp_netif, &ppp_config); #endif // ESP-IDF >= v4.4 From 4b7d1943ac13dc2059960a0f914c74d9d7080096 Mon Sep 17 00:00:00 2001 From: Suren Gabrielyan Date: Thu, 14 Sep 2023 13:05:32 +0400 Subject: [PATCH 3/3] fix(ci): fix host test failure for esp_modem --- .github/workflows/modem__build-host-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/modem__build-host-tests.yml b/.github/workflows/modem__build-host-tests.yml index e3a9618db..d54b5d9b2 100644 --- a/.github/workflows/modem__build-host-tests.yml +++ b/.github/workflows/modem__build-host-tests.yml @@ -64,7 +64,7 @@ jobs: COMP_DIR: esp-protocols/components/esp_modem steps: - name: Checkout esp-protocols - uses: actions/checkout@master + uses: actions/checkout@v3 with: path: esp-protocols