From 3ebe9c9ea122fb251a0574f0ef582ce9aedd34c3 Mon Sep 17 00:00:00 2001 From: Jakub Rzeszutko Date: Mon, 20 Sep 2021 14:22:38 +0200 Subject: [PATCH] shell: log backend minor improvements Replace direct setting of the internal shell flag with a dedicated function for this. Signed-off-by: Jakub Rzeszutko --- subsys/shell/shell_log_backend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subsys/shell/shell_log_backend.c b/subsys/shell/shell_log_backend.c index 50d2f7debc2..0c0970c38ad 100644 --- a/subsys/shell/shell_log_backend.c +++ b/subsys/shell/shell_log_backend.c @@ -157,7 +157,7 @@ bool z_shell_log_backend_process(const struct shell_log_backend *backend) (const struct shell *)backend->backend->cb->ctx; uint32_t dropped; bool colors = IS_ENABLED(CONFIG_SHELL_VT100_COLORS) && - shell->ctx->internal.flags.use_colors; + z_flag_use_colors_get(shell); dropped = atomic_set(&backend->control_block->dropped_cnt, 0); if (dropped) { @@ -193,7 +193,7 @@ static void put(const struct log_backend *const backend, struct log_msg *msg) { const struct shell *shell = (const struct shell *)backend->cb->ctx; bool colors = IS_ENABLED(CONFIG_SHELL_VT100_COLORS) && - shell->ctx->internal.flags.use_colors; + z_flag_use_colors_get(shell); struct k_poll_signal *signal; log_msg_get(msg); @@ -387,7 +387,7 @@ static bool process_msg2_from_buffer(const struct shell *shell) const struct log_output *log_output = log_backend->log_output; union log_msg2_generic *msg; bool colors = IS_ENABLED(CONFIG_SHELL_VT100_COLORS) && - shell->ctx->internal.flags.use_colors; + z_flag_use_colors_get(shell); msg = (union log_msg2_generic *)mpsc_pbuf_claim(mpsc_buffer); if (!msg) { @@ -409,7 +409,7 @@ static void log2_process(const struct log_backend *const backend, struct mpsc_pbuf_buffer *mpsc_buffer = log_backend->mpsc_buffer; const struct log_output *log_output = log_backend->log_output; bool colors = IS_ENABLED(CONFIG_SHELL_VT100_COLORS) && - shell->ctx->internal.flags.use_colors; + z_flag_use_colors_get(shell); struct k_poll_signal *signal; switch (shell->log_backend->control_block->state) {