[Cryptech-Commits] [sw/stm32] branch master updated: Don't reboot when CLI logout is intended.

git at cryptech.is git at cryptech.is
Tue Jun 7 18:57:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/stm32.

The following commit(s) were added to refs/heads/master by this push:
       new  8c345a8   Don't reboot when CLI logout is intended.
8c345a8 is described below

commit 8c345a87ef4d72d3aef2af9fc4114599d7ee0e56
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Tue Jun 7 14:56:58 2016 -0400

    Don't reboot when CLI logout is intended.
---
 projects/cli-test/cli-test.c | 12 +++++-------
 projects/cli-test/mgmt-cli.c |  3 ++-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/projects/cli-test/cli-test.c b/projects/cli-test/cli-test.c
index ed6aac3..a52dbec 100644
--- a/projects/cli-test/cli-test.c
+++ b/projects/cli-test/cli-test.c
@@ -98,13 +98,11 @@ main()
     led_off(LED_RED);
     led_on(LED_GREEN);
 
-    embedded_cli_loop(&cli);
-
-    /* embedded_cli_loop returns when the user enters 'quit' or 'exit' */
-
-    cli_print(&cli, "Rebooting in 3 seconds");
-    HAL_Delay(3000);
-    HAL_NVIC_SystemReset();
+    while (1) {
+        embedded_cli_loop(&cli);
+        /* embedded_cli_loop returns when the user enters 'quit' or 'exit' */
+        cli_print(&cli, "\nLogging out...\n");
+    }
 
     /* NOT REACHED */
     Error_Handler();
diff --git a/projects/cli-test/mgmt-cli.c b/projects/cli-test/mgmt-cli.c
index 3b4ffe9..9488398 100644
--- a/projects/cli-test/mgmt-cli.c
+++ b/projects/cli-test/mgmt-cli.c
@@ -147,7 +147,8 @@ int embedded_cli_loop(struct cli_def *cli)
 		continue;
 	}
 
-	if (ctx.l < 0) break;
+	if (ctx.l < 0)
+            continue;
 
 	/* cli_print(cli, "Process command: '%s'", ctx.cmd); */
 	n = cli_loop_process_cmd(cli, &ctx);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list