From: Richard Burgess <> Date: Thu, 9 Feb 1995 15:58:06 +0000 (+0000) Subject: autocommit for file dated 1995-02-09 15:58:06 X-Git-Url: https://pd.if.org/git/?p=mmurtl;a=commitdiff_plain;h=8121d555a4749c4fc370434209ff5291a0d6888d autocommit for file dated 1995-02-09 15:58:06 --- diff --git a/msamples/busyloop/busyloop.c b/msamples/busyloop/busyloop.c new file mode 100644 index 0000000..71e2024 --- /dev/null +++ b/msamples/busyloop/busyloop.c @@ -0,0 +1,33 @@ +/* Busy loop demonstrates the preemptive capabilites of MMURTL. + It doesn't go through the kernel and never sleeps. It is + a task that is ALWAYS ready to run. + + It runs at the default priority of 25, and rest assured, + other higher priority tasks will receive messages and be + queued to run. + + If you run it, you will have to use the CTRL-ALT-DELETE keys + to kill it. + To build, use MakeIt.bat, or use CM32 or DASM separately: + CM32 BusyLoop.c + DASM BusyLoop.atf +*/ + +#include +#include "\OSSource\Mtimer.h" +#include "\OSSource\MJob.h" + +unsigned long tick; + +void main(void) +{ +long i; + SetJobName("BusyLoop", 8); + Sleep(100); /* A small delay before we start eating CPU time */ + while (1) + { + GetTimerTick(&tick); + printf("%d \r\n", tick); + i++; + } +}