aboutsummaryrefslogtreecommitdiff
path: root/projects/cli-test/cli-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'projects/cli-test/cli-test.c')
-rw-r--r--projects/cli-test/cli-test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/projects/cli-test/cli-test.c b/projects/cli-test/cli-test.c
index 5d33b27..edbc056 100644
--- a/projects/cli-test/cli-test.c
+++ b/projects/cli-test/cli-test.c
@@ -80,6 +80,11 @@ int cmd_filetransfer(struct cli_def *cli, const char *command, char *argv[], int
return CLI_OK;
}
+int cmd_reboot(struct cli_def *cli, const char *command, char *argv[], int argc)
+{
+ HAL_NVIC_SystemReset();
+}
+
int embedded_cli_loop(struct cli_def *cli)
{
unsigned char c;
@@ -150,6 +155,9 @@ main()
struct cli_command cmd_filetransfer_s = {(char *) "filetransfer", cmd_filetransfer, 0,
(char *) "Test file transfering",
PRIVILEGE_UNPRIVILEGED, MODE_EXEC, NULL, NULL, NULL};
+ struct cli_command cmd_reboot_s = {(char *) "reboot", cmd_reboot, 0,
+ (char *) "Reboot the STM32",
+ PRIVILEGE_UNPRIVILEGED, MODE_EXEC, NULL, NULL, NULL};
char crlf[] = "\r\n";
uint8_t tx = 'A';
@@ -177,6 +185,8 @@ main()
cli_register_command2(&cli, &cmd_filetransfer_s, NULL);
+ cli_register_command2(&cli, &cmd_reboot_s, NULL);
+
HAL_GPIO_WritePin(LED_PORT, LED_RED, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LED_PORT, LED_GREEN, GPIO_PIN_SET);