shell: Fix immediate logging case
When logging is using immediate mode then logging messages can be processed from any context, including interrupt context. z_shell_fprintf was asserting in that case since it allowed to be called from interrupt context only when logging was in panic mode. However, shell works in the same way when logging is in immediate mode as in panic mode. Renamed internal shell flag from panic_mode to sync_mode. Flag is also set when shell log backend is started in synchronous mode (immediate logging) which prevents assertion. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
a89e60d7d8
commit
4100c57faa
4 changed files with 8 additions and 7 deletions
|
@ -56,6 +56,7 @@ void z_shell_log_backend_enable(const struct shell_log_backend *backend,
|
|||
|
||||
shell = (const struct shell *)ctx;
|
||||
|
||||
z_flag_sync_mode_set(shell, true);
|
||||
/* Reenable transport in blocking mode */
|
||||
err = shell->iface->api->enable(shell->iface, true);
|
||||
}
|
||||
|
@ -289,7 +290,7 @@ static void panic(const struct log_backend *const backend)
|
|||
if (err == 0) {
|
||||
shell->log_backend->control_block->state =
|
||||
SHELL_LOG_BACKEND_PANIC;
|
||||
z_flag_panic_mode_set(shell, true);
|
||||
z_flag_sync_mode_set(shell, true);
|
||||
|
||||
/* Move to the start of next line. */
|
||||
z_shell_multiline_data_calc(&shell->ctx->vt100_ctx.cons,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue