From e85a85d9c3d69c63521d077d80b59f84bbfc926a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 5 Sep 2020 16:56:56 +0200 Subject: [PATCH] Issue #18: ommand to shell in order to test panic mode --- stm-firmware/shell.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/stm-firmware/shell.c b/stm-firmware/shell.c index 481ff28..db8ef9d 100644 --- a/stm-firmware/shell.c +++ b/stm-firmware/shell.c @@ -38,6 +38,7 @@ #include #include #include +#include #ifndef GIT_VER #define GIT_VER "VERSION NOT SET" @@ -501,6 +502,19 @@ static shellmatta_retCode_t shell_cmd_ui_emulation(const shellmatta_handle_t han return SHELLMATTA_CONTINUE; } +static shellmatta_retCode_t shell_cmd_panic(const shellmatta_handle_t handle, const char *arguments, + uint32_t length) + +{ + (void)handle; + (void)arguments; + (void)length; + + panic_mode(); + + return SHELLMATTA_OK; +} + //typedef struct shellmatta_cmd //{ // char *cmd; /**< command name */ @@ -510,7 +524,7 @@ static shellmatta_retCode_t shell_cmd_ui_emulation(const shellmatta_handle_t han // shellmatta_cmdFct_t cmdFct; /**< pointer to the cmd callack function */ // struct shellmatta_cmd *next; /**< pointer to next command or NULL */ //} shellmatta_cmd_t; -static shellmatta_cmd_t cmd[16] = { +static shellmatta_cmd_t cmd[17] = { { .cmd = "version", .cmdAlias = "ver", @@ -637,6 +651,14 @@ static shellmatta_cmd_t cmd[16] = { .helpText = "", .usageText = "", .cmdFct = shell_cmd_ui_emulation, + .next = &cmd[16], + }, + { + .cmd = "panic", + .cmdAlias = NULL, + .helpText = "Panic Mode!", + .usageText = "", + .cmdFct = shell_cmd_panic, .next = NULL, }, };