Lines Matching full:sh
12 static bool process_msg_from_buffer(const struct shell *sh);
32 const struct shell *sh; in z_shell_log_backend_enable() local
34 sh = (const struct shell *)ctx; in z_shell_log_backend_enable()
36 z_flag_sync_mode_set(sh, true); in z_shell_log_backend_enable()
38 err = sh->iface->api->enable(sh->iface, true); in z_shell_log_backend_enable()
58 const struct shell *sh = in z_shell_log_backend_process() local
62 z_flag_use_colors_get(sh); in z_shell_log_backend_process()
69 z_shell_vt100_colors_store(sh, &col); in z_shell_log_backend_process()
70 z_shell_vt100_color_set(sh, SHELL_VT100_COLOR_RED); in z_shell_log_backend_process()
76 z_shell_vt100_colors_restore(sh, &col); in z_shell_log_backend_process()
80 return process_msg_from_buffer(sh); in z_shell_log_backend_process()
85 const struct shell *sh = (const struct shell *)backend->cb->ctx; in panic() local
92 err = sh->iface->api->enable(sh->iface, true); in panic()
95 sh->log_backend->control_block->state = in panic()
97 z_flag_sync_mode_set(sh, true); in panic()
100 z_shell_multiline_data_calc(&sh->ctx->vt100_ctx.cons, in panic()
101 sh->ctx->cmd_buff_pos, in panic()
102 sh->ctx->cmd_buff_len); in panic()
103 z_shell_op_cursor_vert_move(sh, -1); in panic()
104 z_shell_op_cursor_horiz_move(sh, in panic()
105 -sh->ctx->vt100_ctx.cons.cur_x); in panic()
107 while (process_msg_from_buffer(sh)) { in panic()
111 z_shell_log_backend_disable(sh->log_backend); in panic()
117 const struct shell *sh = (const struct shell *)backend->cb->ctx; in dropped() local
118 const struct shell_log_backend *log_backend = sh->log_backend; in dropped()
121 atomic_add(&sh->stats->log_lost_cnt, cnt); in dropped()
158 static void process_log_msg(const struct shell *sh, in process_log_msg() argument
183 k_mutex_lock(&sh->ctx->wr_mtx, K_FOREVER); in process_log_msg()
185 if (!z_flag_cmd_ctx_get(sh)) { in process_log_msg()
186 z_shell_cmd_line_erase(sh); in process_log_msg()
193 if (!z_flag_cmd_ctx_get(sh)) { in process_log_msg()
194 z_shell_print_prompt_and_cmd(sh); in process_log_msg()
199 k_mutex_unlock(&sh->ctx->wr_mtx); in process_log_msg()
204 static bool process_msg_from_buffer(const struct shell *sh) in process_msg_from_buffer() argument
206 const struct shell_log_backend *log_backend = sh->log_backend; in process_msg_from_buffer()
211 z_flag_use_colors_get(sh); in process_msg_from_buffer()
218 process_log_msg(sh, log_output, msg, false, colors); in process_msg_from_buffer()
228 const struct shell *sh = (const struct shell *)backend->cb->ctx; in process() local
229 const struct shell_log_backend *log_backend = sh->log_backend; in process()
233 z_flag_use_colors_get(sh); in process()
236 switch (sh->log_backend->control_block->state) { in process()
239 process_log_msg(sh, log_output, msg, true, colors); in process()
243 signal = &sh->ctx->signals[SHELL_SIGNAL_LOG_MSG]; in process()
253 z_shell_cmd_line_erase(sh); in process()
254 process_log_msg(sh, log_output, msg, true, colors); in process()