Fix #13: Add hang command to shell

This commit is contained in:
Mario Hüttel 2020-08-21 00:29:19 +02:00
parent 432d30cc34
commit 95de84fa85
1 changed files with 23 additions and 3 deletions

View File

@ -445,6 +445,19 @@ static shellmatta_retCode_t shell_cmd_save_cal(const shellmatta_handle_t handle,
return SHELLMATTA_OK;
}
static shellmatta_retCode_t shell_cmd_hang(const shellmatta_handle_t handle, const char *arguments,
uint32_t length)
{
(void)handle;
(void)arguments;
(void)length;
while (1337);
return SHELLMATTA_OK;
}
//typedef struct shellmatta_cmd
//{
// char *cmd; /**< command name */
@ -454,8 +467,7 @@ static shellmatta_retCode_t shell_cmd_save_cal(const shellmatta_handle_t handle,
// 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[14] = {
static shellmatta_cmd_t cmd[15] = {
{
.cmd = "version",
.cmdAlias = "ver",
@ -566,8 +578,16 @@ static shellmatta_cmd_t cmd[14] = {
.helpText = "",
.usageText = "",
.cmdFct = shell_cmd_save_cal,
.next = NULL,
.next = &cmd[14],
},
{
.cmd = "hang",
.cmdAlias = NULL,
.helpText = "",
.usageText = "",
.cmdFct = shell_cmd_hang,
.next = NULL,
}
};
shellmatta_handle_t shell_init(shellmatta_write_t write_func)