shell: fix assert in panic mode

In panic mode, the function: z_shell_fprintf is expected to be
called from an interrupt context. Therefore, the dedicated assert
cannot be checked in this case.

Fixes #38612

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2021-09-21 11:10:28 +02:00 committed by Christopher Friedt
commit 8b8a3bbf71
4 changed files with 29 additions and 13 deletions

View file

@ -289,6 +289,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);
/* Move to the start of next line. */
z_shell_multiline_data_calc(&shell->ctx->vt100_ctx.cons,