From d468cc0b222f77ef1c2015447ee5bb3733e85122 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Aug 2016 08:41:02 +0200 Subject: [PATCH] shell command for application version added --- source/application/shell_commands.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/application/shell_commands.c b/source/application/shell_commands.c index 0cb89f8..2be40f6 100644 --- a/source/application/shell_commands.c +++ b/source/application/shell_commands.c @@ -6,6 +6,7 @@ */ #include #include +#include #include "list.h" #include "driver.h" @@ -72,6 +73,7 @@ static struct command drive_turn_right = { int shell_commands_init(void) { + shell_add_command(&cmd_app_version); shell_add_command(&drive_forward); shell_add_command(&drive_backward); shell_add_command(&drive_boost); @@ -79,7 +81,6 @@ int shell_commands_init(void) shell_add_command(&drive_halt); shell_add_command(&drive_turn_left); shell_add_command(&drive_turn_right); - shell_add_command(&cmd_app_version); return 0; } @@ -162,15 +163,15 @@ static void *drive_backward_cb(const char *param) static void *app_version(const char *param) { -#if 0 char *greeter = "engine_control version: "; - drv_write(shell_object.shell_device, greeter, strlen(greeter)); - drv_write(shell_object.shell_device, MAJOR_VERSION, strlen(MAJOR_VERSION)); - drv_write(shell_object.shell_device, ".", 1); - drv_write(shell_object.shell_device, MINOR_VERSION, strlen(MINOR_VERSION)); - drv_write(shell_object.shell_device, ".", 1); - drv_write(shell_object.shell_device, BUILD_NUMBER, strlen(BUILD_NUMBER)); -#endif + shell_write(greeter, strlen(greeter)); + shell_write(MAJOR_VERSION, strlen(MAJOR_VERSION)); + shell_write(".", 1); + shell_write(MINOR_VERSION, strlen(MINOR_VERSION)); + shell_write(".", 1); + shell_write(BUILD_NUMBER, strlen(BUILD_NUMBER)); + shell_write("\r\n", 2); + return NULL; }