Skip to content

Commit

Permalink
fix(modem): Fix vfs terminal not to reset read_cb() automatically
Browse files Browse the repository at this point in the history
This change is needed for the fs terminal to work correctly again, after
merging 44bae24 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.
  • Loading branch information
david-cermak committed Sep 20, 2023
1 parent 12bacdc commit 25a35e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/esp_modem/include/vfs_resource/vfs_create.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
4 changes: 1 addition & 3 deletions components/esp_modem/src/esp_modem_term_fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 25a35e2

Please sign in to comment.