shell command for application version added

This commit is contained in:
Thomas Klaehn 2016-08-30 08:41:02 +02:00
parent f3113146fd
commit d468cc0b22

View File

@ -6,6 +6,7 @@
*/
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#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;
}