application: add reset action

This commit is contained in:
King Kévin 2018-01-17 18:30:08 +01:00
parent 4a8bf5d2a1
commit b2c823f858
1 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,7 @@ static void process_command(char* str)
printf("l|led [on|off|toggle]\n");
printf("s|self-test\n");
printf("p|pin-test\n");
printf("r|reset\n");
} else if (0==strcmp(word,"l") || 0==strcmp(word,"led")) {
word = strtok(NULL,delimiter);
if (!word) {
@ -148,6 +149,9 @@ static void process_command(char* str)
} else {
printf("pin :test aborted\n");
}
} else if (0==strcmp(word,"r") || 0==strcmp(word,"reset")) {
scb_reset_system(); // reset device
while (true); // wait for the reset to happen
} else {
goto error;
}