aboutsummaryrefslogtreecommitdiffstats
path: root/demos/Win32-MinGW/demo.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-10-03 17:14:03 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-10-03 17:14:03 +0000
commit2310f80695b4051cb63ca14878dfc5e76acb94e6 (patch)
tree70643e03f918333f051734336f97011644da076a /demos/Win32-MinGW/demo.c
parent1b269aa139ba66288cc2c3f1b463c73821343262 (diff)
downloadChibiOS-2310f80695b4051cb63ca14878dfc5e76acb94e6.tar.gz
ChibiOS-2310f80695b4051cb63ca14878dfc5e76acb94e6.tar.bz2
ChibiOS-2310f80695b4051cb63ca14878dfc5e76acb94e6.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@30 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/Win32-MinGW/demo.c')
-rw-r--r--demos/Win32-MinGW/demo.c17
1 files changed, 14 insertions, 3 deletions
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");