Add exit() function on finsh shell.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2368 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2012-10-23 02:42:52 +00:00
parent 409dd3801f
commit 6fa4aa965c
2 changed files with 22 additions and 29 deletions

View File

@ -16,21 +16,12 @@
#include <stdio.h>
#include <board.h>
#ifdef RT_USING_DFS
/* dfs init */
#include <dfs_init.h>
/* dfs filesystem:ELM filesystem init */
#include <dfs_elm.h>
/* dfs Filesystem APIs */
#include <dfs_fs.h>
#endif
#include <components.h>
void rt_init_thread_entry(void* parameter)
{
#ifdef RT_USING_COMPONENTS_INIT
/* initialization RT-Thread Components */
rt_components_init();
#endif
rt_platform_init();
@ -66,7 +57,6 @@ void rt_init_thread_entry(void* parameter)
else
rt_kprintf("jffs2 initialzation failed!\n");
#endif
}
#endif
}
@ -81,30 +71,32 @@ void rt_test_thread_entry(void* parameter)
}
}
#include <finsh.h>
int rt_application_init()
{
rt_thread_t thread;
rt_thread_t tid;
#if (RT_THREAD_PRIORITY_MAX == 32)
thread = rt_thread_create("init",
tid = rt_thread_create("init",
rt_init_thread_entry, RT_NULL,
2048, 8, 20);
#else
thread = rt_thread_create("init",
rt_init_thread_entry, RT_NULL,
2048, 80, 20);
#endif
2048, RT_THREAD_PRIORITY_MAX/3, 20);
if (thread != RT_NULL)
rt_thread_startup(thread);
if (tid != RT_NULL)
rt_thread_startup(tid);
thread = rt_thread_create("test",
tid = rt_thread_create("test",
rt_test_thread_entry, RT_NULL,
2048, 9, 20);
if (thread != RT_NULL)
rt_thread_startup(thread);
2048, RT_THREAD_PRIORITY_MAX * 3 /4, 20);
if (tid != RT_NULL)
rt_thread_startup(tid);
return 0;
}
#include <stdlib.h>
void rt_hw_exit(void)
{
rt_kprintf("RT-Thread, bye\n");
exit(0);
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_exit, exit, exit rt-thread);
/*@}*/

View File

@ -1,6 +1,7 @@
/* RT-Thread config file */
#ifndef __RTTHREAD_CFG_H__
#define __RTTHREAD_CFG_H__
#ifdef _MSC_VER
#undef RT_USING_NEWLIB
#undef RT_USING_MINILIBC