提交 91ecf31a 编写于 作者: qiuyiuestc's avatar qiuyiuestc

move thread directory

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@656 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 1f42e27e
Import('env')
target = 'thread.mo'
module_env = env.Clone(CPPDEFINE = 'RT_MODULE')
module_env.Replace(LINKFLAGS = ' -r -d -e rtm_main -nostdlib')
src_local = Glob('*.c')
module_env.Program(target, src_local)
#include <rtthread.h>
#define THREAD_PRIORITY 25
#define THREAD_STACK_SIZE 512
#define THREAD_TIMESLICE 5
static void thread_entry(void* parameter)
{
rt_kprintf("thread dynamicly created ok\n");
rt_thread_delay(10);
rt_kprintf("thread exit\n");
}
int rtm_main()
{
rt_thread_t tid;
tid = rt_thread_create("test",
thread_entry, RT_NULL,
THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE);
if (tid != RT_NULL)
rt_thread_startup(tid);
return 0;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册