diff --git a/subsys/shell/modules/device_service.c b/subsys/shell/modules/device_service.c index 4a3afcf1bfe..e0d9104bdc8 100644 --- a/subsys/shell/modules/device_service.c +++ b/subsys/shell/modules/device_service.c @@ -35,7 +35,7 @@ static bool device_get_config_level(const struct shell *shell, int level) info++) { if (info->driver_api != NULL) { devices = true; - shell_fprintf(shell, SHELL_NORMAL, "- %s\r\n", + shell_fprintf(shell, SHELL_NORMAL, "- %s\n", info->config->name); } } @@ -49,28 +49,28 @@ static int cmd_device_levels(const struct shell *shell, ARG_UNUSED(argv); bool ret; - shell_fprintf(shell, SHELL_NORMAL, "POST_KERNEL:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "POST_KERNEL:\n"); ret = device_get_config_level(shell, _SYS_INIT_LEVEL_POST_KERNEL); if (ret == false) { - shell_fprintf(shell, SHELL_NORMAL, "- None\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "- None\n"); } - shell_fprintf(shell, SHELL_NORMAL, "APPLICATION:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "APPLICATION:\n"); ret = device_get_config_level(shell, _SYS_INIT_LEVEL_APPLICATION); if (ret == false) { - shell_fprintf(shell, SHELL_NORMAL, "- None\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "- None\n"); } - shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 1:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 1:\n"); ret = device_get_config_level(shell, _SYS_INIT_LEVEL_PRE_KERNEL_1); if (ret == false) { - shell_fprintf(shell, SHELL_NORMAL, "- None\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "- None\n"); } - shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 2:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 2:\n"); ret = device_get_config_level(shell, _SYS_INIT_LEVEL_PRE_KERNEL_2); if (ret == false) { - shell_fprintf(shell, SHELL_NORMAL, "- None\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "- None\n"); } return 0; @@ -83,10 +83,10 @@ static int cmd_device_list(const struct shell *shell, ARG_UNUSED(argc); ARG_UNUSED(argv); - shell_fprintf(shell, SHELL_NORMAL, "devices:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "devices:\n"); for (info = __device_init_start; info != __device_init_end; info++) { if (info->driver_api != NULL) { - shell_fprintf(shell, SHELL_NORMAL, "- %s\r\n", + shell_fprintf(shell, SHELL_NORMAL, "- %s\n", info->config->name); } } diff --git a/subsys/shell/modules/kernel_service.c b/subsys/shell/modules/kernel_service.c index 6d3635e65f0..8f8c4dc4ed0 100644 --- a/subsys/shell/modules/kernel_service.c +++ b/subsys/shell/modules/kernel_service.c @@ -22,7 +22,7 @@ static int cmd_kernel_version(const struct shell *shell, ARG_UNUSED(argc); ARG_UNUSED(argv); - shell_fprintf(shell, SHELL_NORMAL, "Zephyr version %d.%d.%d\r\n", + shell_fprintf(shell, SHELL_NORMAL, "Zephyr version %d.%d.%d\n", SYS_KERNEL_VER_MAJOR(version), SYS_KERNEL_VER_MINOR(version), SYS_KERNEL_VER_PATCHLEVEL(version)); @@ -35,7 +35,7 @@ static int cmd_kernel_uptime(const struct shell *shell, ARG_UNUSED(argc); ARG_UNUSED(argv); - shell_fprintf(shell, SHELL_NORMAL, "Uptime: %u ms\r\n", + shell_fprintf(shell, SHELL_NORMAL, "Uptime: %u ms\n", k_uptime_get_32()); return 0; } @@ -46,7 +46,7 @@ static int cmd_kernel_cycles(const struct shell *shell, ARG_UNUSED(argc); ARG_UNUSED(argv); - shell_fprintf(shell, SHELL_NORMAL, "cycles: %u hw cycles\r\n", + shell_fprintf(shell, SHELL_NORMAL, "cycles: %u hw cycles\n", k_cycle_get_32()); return 0; } @@ -68,16 +68,16 @@ static void shell_tdata_dump(const struct k_thread *thread, void *user_data) tname = k_thread_name_get((struct k_thread *)thread); shell_fprintf((const struct shell *)user_data, SHELL_NORMAL, - "%s%p %-10s\r\n", + "%s%p %-10s\n", (thread == k_current_get()) ? "*" : " ", thread, tname ? tname : "NA"); shell_fprintf((const struct shell *)user_data, SHELL_NORMAL, - "\toptions: 0x%x, priority: %d\r\n", + "\toptions: 0x%x, priority: %d\n", thread->base.user_options, thread->base.prio); shell_fprintf((const struct shell *)user_data, SHELL_NORMAL, - "\tstack size %u, unused %u, usage %u / %u (%u %%)\r\n\n", + "\tstack size %u, unused %u, usage %u / %u (%u %%)\n\n", size, unused, size - unused, size, pcnt); } @@ -88,7 +88,7 @@ static int cmd_kernel_threads(const struct shell *shell, ARG_UNUSED(argc); ARG_UNUSED(argv); - shell_fprintf(shell, SHELL_NORMAL, "Threads:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "Threads:\n"); k_thread_foreach(shell_tdata_dump, (void *)shell); return 0; } @@ -107,7 +107,7 @@ static void shell_stack_dump(const struct k_thread *thread, void *user_data) pcnt = ((size - unused) * 100) / size; shell_fprintf((const struct shell *)user_data, SHELL_NORMAL, - "0x%08X %-10s (real size %u):\tunused %u\tusage %u / %u (%u %%)\r\n", + "0x%08X %-10s (real size %u):\tunused %u\tusage %u / %u (%u %%)\n", (u32_t)thread, tname ? tname : "NA", size, unused, size - unused, size, pcnt); diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index ea472f02d80..eb4d54e5622 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -193,7 +193,7 @@ static void tab_item_print(const struct shell *shell, const char *option, diff = longest_option - shell_strlen(option); if (shell->ctx->vt100_ctx.printed_cmd++ % columns == 0) { - shell_fprintf(shell, SHELL_OPTION, "\r\n%s%s", tab, option); + shell_fprintf(shell, SHELL_OPTION, "\n%s%s", tab, option); } else { shell_fprintf(shell, SHELL_OPTION, "%s", option); } @@ -1326,7 +1326,7 @@ int shell_start(const struct shell *shell) vt100_color_set(shell, SHELL_NORMAL); } - shell_raw_fprintf(shell->fprintf_ctx, "\r\n\n"); + shell_raw_fprintf(shell->fprintf_ctx, "\n\n"); shell_state_set(shell, SHELL_STATE_ACTIVE); diff --git a/subsys/shell/shell_help.c b/subsys/shell/shell_help.c index 825b92a16e4..d4ac77e6650 100644 --- a/subsys/shell/shell_help.c +++ b/subsys/shell/shell_help.c @@ -175,7 +175,7 @@ void shell_help_subcmd_print(const struct shell *shell) return; } - shell_fprintf(shell, SHELL_NORMAL, "Subcommands:\r\n"); + shell_fprintf(shell, SHELL_NORMAL, "Subcommands:\n"); /* Printing subcommands and help string (if exists). */ cmd_idx = 0; diff --git a/subsys/shell/shell_ops.h b/subsys/shell/shell_ops.h index 5549191aa0b..70e63b2bde4 100644 --- a/subsys/shell/shell_ops.h +++ b/subsys/shell/shell_ops.h @@ -59,7 +59,7 @@ static inline void cursor_restore(const struct shell *shell) */ static inline void cursor_next_line_move(const struct shell *shell) { - shell_raw_fprintf(shell->fprintf_ctx, "\r\n"); + shell_raw_fprintf(shell->fprintf_ctx, "\n"); } /* Function sends 1 character to the shell instance. */ diff --git a/subsys/shell/shell_utils.h b/subsys/shell/shell_utils.h index 3d9b4724f2b..3848368b370 100644 --- a/subsys/shell/shell_utils.h +++ b/subsys/shell/shell_utils.h @@ -13,7 +13,7 @@ extern "C" { #endif -#define SHELL_MSG_SPECIFY_SUBCOMMAND "Please specify a subcommand.\r\n" +#define SHELL_MSG_SPECIFY_SUBCOMMAND "Please specify a subcommand.\n" #define SHELL_DEFAULT_TERMINAL_WIDTH (80u) /* Default PuTTY width. */ #define SHELL_DEFAULT_TERMINAL_HEIGHT (24u) /* Default PuTTY height. */ diff --git a/subsys/shell/shell_wildcard.c b/subsys/shell/shell_wildcard.c index b77d963b5ca..288996f67e9 100644 --- a/subsys/shell/shell_wildcard.c +++ b/subsys/shell/shell_wildcard.c @@ -112,7 +112,7 @@ static enum shell_wildcard_status commands_expand(const struct shell *shell, SHELL_WARNING, "Command buffer is too short to" " expand all commands matching" - " wildcard pattern: %s\r\n", + " wildcard pattern: %s\n", pattern); break; } else if (ret_val != SHELL_WILDCARD_CMD_ADDED) {