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 44bae24c78 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.
This commit is contained in:
David Cermak
2023-09-20 09:46:39 +02:00
parent 12bacdc3a0
commit 25a35e20a3
2 changed files with 2 additions and 4 deletions

View File

@ -14,7 +14,7 @@
.stop_bits = UART_STOP_BITS_1, \ .stop_bits = UART_STOP_BITS_1, \
.parity = UART_PARITY_DISABLE, \ .parity = UART_PARITY_DISABLE, \
.flow_control = ESP_MODEM_FLOW_CONTROL_NONE,\ .flow_control = ESP_MODEM_FLOW_CONTROL_NONE,\
.source_clk = UART_SCLK_APB, \ .source_clk = ESP_MODEM_DEFAULT_UART_CLK, \
.baud_rate = 115200, \ .baud_rate = 115200, \
.tx_io_num = 25, \ .tx_io_num = 25, \
.rx_io_num = 26, \ .rx_io_num = 26, \

View File

@ -122,9 +122,7 @@ void FdTerminal::task()
} else { } else {
if (FD_ISSET(f.fd, &rfds)) { if (FD_ISSET(f.fd, &rfds)) {
if (on_read_priv) { if (on_read_priv) {
if (on_read_priv(nullptr, 0)) { on_read_priv(nullptr, 0);
on_read_priv = nullptr;
}
} }
} }
} }