shell: telnet: Replace timer with a delayed work

A `k_timer` callback is called from the ISR context on certain devices
(nRF), which resulted in an assert in the kernel, as `telnet_send`, and
thus `net_context_send` used a mutex.

Fix the issue by replacing a timer used by the `shell_telnet` module
with a delayed work, which will execute it's callback in a system
workqueue context.

Fixes #22697

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2020-02-11 16:31:12 +01:00 committed by Jukka Rissanen
commit 4f9b9a4500
2 changed files with 9 additions and 9 deletions

View file

@ -41,11 +41,11 @@ struct shell_telnet {
/** RX packet FIFO. */
struct k_fifo rx_fifo;
/** The timer is used to send non-lf terminated output that has
/** The delayed work is used to send non-lf terminated output that has
* been around for "too long". This will prove to be useful
* to send the shell prompt for instance.
*/
struct k_timer send_timer;
struct k_delayed_work send_work;
/** If set, no output is sent to the TELNET client. */
bool output_lock;