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:
parent
409dd3801f
commit
6fa4aa965c
|
@ -16,21 +16,12 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
|
||||||
#ifdef RT_USING_DFS
|
#include <components.h>
|
||||||
/* dfs init */
|
|
||||||
#include <dfs_init.h>
|
|
||||||
/* dfs filesystem:ELM filesystem init */
|
|
||||||
#include <dfs_elm.h>
|
|
||||||
/* dfs Filesystem APIs */
|
|
||||||
#include <dfs_fs.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void rt_init_thread_entry(void* parameter)
|
void rt_init_thread_entry(void* parameter)
|
||||||
{
|
{
|
||||||
#ifdef RT_USING_COMPONENTS_INIT
|
|
||||||
/* initialization RT-Thread Components */
|
/* initialization RT-Thread Components */
|
||||||
rt_components_init();
|
rt_components_init();
|
||||||
#endif
|
|
||||||
|
|
||||||
rt_platform_init();
|
rt_platform_init();
|
||||||
|
|
||||||
|
@ -66,7 +57,6 @@ void rt_init_thread_entry(void* parameter)
|
||||||
else
|
else
|
||||||
rt_kprintf("jffs2 initialzation failed!\n");
|
rt_kprintf("jffs2 initialzation failed!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -81,30 +71,32 @@ void rt_test_thread_entry(void* parameter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <finsh.h>
|
|
||||||
int rt_application_init()
|
int rt_application_init()
|
||||||
{
|
{
|
||||||
rt_thread_t thread;
|
rt_thread_t tid;
|
||||||
|
|
||||||
#if (RT_THREAD_PRIORITY_MAX == 32)
|
tid = rt_thread_create("init",
|
||||||
thread = rt_thread_create("init",
|
rt_init_thread_entry, RT_NULL,
|
||||||
rt_init_thread_entry, RT_NULL,
|
2048, RT_THREAD_PRIORITY_MAX/3, 20);
|
||||||
2048, 8, 20);
|
|
||||||
#else
|
|
||||||
thread = rt_thread_create("init",
|
|
||||||
rt_init_thread_entry, RT_NULL,
|
|
||||||
2048, 80, 20);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (thread != RT_NULL)
|
if (tid != RT_NULL)
|
||||||
rt_thread_startup(thread);
|
rt_thread_startup(tid);
|
||||||
|
|
||||||
thread = rt_thread_create("test",
|
tid = rt_thread_create("test",
|
||||||
rt_test_thread_entry, RT_NULL,
|
rt_test_thread_entry, RT_NULL,
|
||||||
2048, 9, 20);
|
2048, RT_THREAD_PRIORITY_MAX * 3 /4, 20);
|
||||||
if (thread != RT_NULL)
|
if (tid != RT_NULL)
|
||||||
rt_thread_startup(thread);
|
rt_thread_startup(tid);
|
||||||
|
|
||||||
return 0;
|
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);
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* RT-Thread config file */
|
/* RT-Thread config file */
|
||||||
#ifndef __RTTHREAD_CFG_H__
|
#ifndef __RTTHREAD_CFG_H__
|
||||||
#define __RTTHREAD_CFG_H__
|
#define __RTTHREAD_CFG_H__
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#undef RT_USING_NEWLIB
|
#undef RT_USING_NEWLIB
|
||||||
#undef RT_USING_MINILIBC
|
#undef RT_USING_MINILIBC
|
||||||
|
|
Loading…
Reference in New Issue