summaryrefslogtreecommitdiff
path: root/components/hello
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-04-12 17:37:37 +0000
committerqiuyiuestc <[email protected]>2010-04-12 17:37:37 +0000
commitcbfb87fac1020380eca3b15b32ea738820059007 (patch)
tree23522eed21d5abc36ff4ff9fcbf69806cc13e627 /components/hello
parentadcbe9d53fbd9753a2f3037569e3d2db8876d0d8 (diff)
add module feature
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@614 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/hello')
-rw-r--r--components/hello/hello.c20
-rw-r--r--components/hello/mk.bat3
2 files changed, 21 insertions, 2 deletions
diff --git a/components/hello/hello.c b/components/hello/hello.c
index c4653793a4..6b6402de1c 100644
--- a/components/hello/hello.c
+++ b/components/hello/hello.c
@@ -1,6 +1,22 @@
#include <rtthread.h>
-void hello()
+static int a = 0;
+int b = 1000000;
+
+void function(int count1, int count2)
{
- rt_kprintf("Hello RT-Thread\n");
+ rt_kprintf("Hello RT-Thread %d %d\n", count1, count2);
+}
+
+int rtm_main(void)
+{
+ int i;
+ for(i=0; i<1000; i++)
+ {
+ a++;
+ b--;
+ function(a, b);
+ }
+
+ return 0;
}
diff --git a/components/hello/mk.bat b/components/hello/mk.bat
new file mode 100644
index 0000000000..8f906a3af7
--- /dev/null
+++ b/components/hello/mk.bat
@@ -0,0 +1,3 @@
+set PATH="E:\Program Files\CodeSourcery\Sourcery G++ Lite\bin";%PATH%
+arm-none-eabi-gcc -c hello.c -o hello.o -DRT_MODULE "-I..\..\include" "-I..\..\bsp\mini2440"
+arm-none-eabi-gcc -o hello.mo -r -d -e rtm_main -nostdlib hello.o \ No newline at end of file