From 2310f80695b4051cb63ca14878dfc5e76acb94e6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Oct 2007 17:14:03 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@30 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/Win32-MinGW/demo.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'demos/Win32-MinGW/demo.c') diff --git a/demos/Win32-MinGW/demo.c b/demos/Win32-MinGW/demo.c index 166923d2c..077877f8e 100644 --- a/demos/Win32-MinGW/demo.c +++ b/demos/Win32-MinGW/demo.c @@ -36,6 +36,8 @@ static t_msg WatchdogThread(void *arg); static t_msg ConsoleThread(void *arg); static t_msg InitThread(void *arg); +t_msg TestThread(void *p); + void InitCore(void); extern FullDuplexDriver COM1, COM2; @@ -73,7 +75,7 @@ static t_msg WatchdogThread(void *arg) { printf("Halted by watchdog"); chSysHalt(); } - chThdSleep(5); + chThdSleep(50); } return 0; } @@ -144,7 +146,7 @@ static t_msg HelloWorldThread(void *arg) { for (i = 0; i < 100; i++) { PrintLineFDD(sd, "Hello World\r\n"); - c = chFDDGetTimeout(sd, 33); + c = chFDDGetTimeout(sd, 333); switch (c) { case -1: continue; @@ -154,7 +156,7 @@ static t_msg HelloWorldThread(void *arg) { PrintLineFDD(sd, "^C\r\n"); return 0; default: - chThdSleep(33); + chThdSleep(333); } } return 0; @@ -202,6 +204,7 @@ static t_msg ShellThread(void *arg) { PrintLineFDD(sd, " exit - Logout from ChibiOS/RT\r\n"); PrintLineFDD(sd, " time - Prints the system timer value\r\n"); PrintLineFDD(sd, " hello - Runs the Hello World demo thread\r\n"); + PrintLineFDD(sd, " test - Runs the System Test thread\r\n"); } else if (stricmp(lp, "exit") == 0) { if (checkend(sd)) @@ -223,6 +226,14 @@ static t_msg ShellThread(void *arg) { if (chThdWait(tp)) break; // Lost connection while executing the hello thread. } + else if (stricmp(lp, "test") == 0) { + if (checkend(sd)) + continue; + tp = chThdCreate(NORMALPRIO, 0, tarea, sizeof(tarea), + TestThread, arg); + if (chThdWait(tp)) + break; // Lost connection while executing the hello thread. + } else { PrintLineFDD(sd, lp); PrintLineFDD(sd, " ?\r\n"); -- cgit v1.2.3