diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-10-03 17:14:03 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-10-03 17:14:03 +0000 |
commit | 2310f80695b4051cb63ca14878dfc5e76acb94e6 (patch) | |
tree | 70643e03f918333f051734336f97011644da076a /demos/Win32-MSVS/demo.c | |
parent | 1b269aa139ba66288cc2c3f1b463c73821343262 (diff) | |
download | ChibiOS-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-MSVS/demo.c')
-rw-r--r-- | demos/Win32-MSVS/demo.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/demos/Win32-MSVS/demo.c b/demos/Win32-MSVS/demo.c index d068ca730..077877f8e 100644 --- a/demos/Win32-MSVS/demo.c +++ b/demos/Win32-MSVS/demo.c @@ -31,11 +31,13 @@ static BYTE8 iarea[UserStackSize(2048)]; static ULONG32 cdguard;
static BYTE8 cdarea[UserStackSize(2048)];
static Thread *cdtp;
-
+
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");
@@ -281,7 +292,7 @@ static void COM2Handler(t_eventid id) { static t_evhandler fhandlers[2] = {
COM1Handler,
COM2Handler
-};
+};
/*
* Init-like thread, it starts the shells and handles their termination.
|