Issue #18: ommand to shell in order to test panic mode

This commit is contained in:
Mario Hüttel 2020-09-05 16:56:56 +02:00
parent 3df0631ffc
commit e85a85d9c3

View File

@ -38,6 +38,7 @@
#include <reflow-controller/safety/safety-controller.h> #include <reflow-controller/safety/safety-controller.h>
#include <reflow-controller/settings/settings.h> #include <reflow-controller/settings/settings.h>
#include <reflow-controller/button.h> #include <reflow-controller/button.h>
#include <reflow-controller/safety/fault.h>
#ifndef GIT_VER #ifndef GIT_VER
#define GIT_VER "VERSION NOT SET" #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; 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 //typedef struct shellmatta_cmd
//{ //{
// char *cmd; /**< command name */ // 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 */ // shellmatta_cmdFct_t cmdFct; /**< pointer to the cmd callack function */
// struct shellmatta_cmd *next; /**< pointer to next command or NULL */ // struct shellmatta_cmd *next; /**< pointer to next command or NULL */
//} shellmatta_cmd_t; //} shellmatta_cmd_t;
static shellmatta_cmd_t cmd[16] = { static shellmatta_cmd_t cmd[17] = {
{ {
.cmd = "version", .cmd = "version",
.cmdAlias = "ver", .cmdAlias = "ver",
@ -637,6 +651,14 @@ static shellmatta_cmd_t cmd[16] = {
.helpText = "", .helpText = "",
.usageText = "", .usageText = "",
.cmdFct = shell_cmd_ui_emulation, .cmdFct = shell_cmd_ui_emulation,
.next = &cmd[16],
},
{
.cmd = "panic",
.cmdAlias = NULL,
.helpText = "Panic Mode!",
.usageText = "",
.cmdFct = shell_cmd_panic,
.next = NULL, .next = NULL,
}, },
}; };