未验证 提交 39998e4d 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1602 from aozima/re_initial_dev

add re-initial check.
......@@ -55,8 +55,16 @@ static int fd_alloc(struct dfs_fdtable *fdt, int startfd);
/**
* this function will initialize device file system.
*/
static volatile uint8_t init_ok = 0;
int dfs_init(void)
{
if(init_ok)
{
rt_kprintf("dfs already init.\n");
return 0;
}
init_ok = 1;
/* clear filesystem operations table */
memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
/* clear filesystem table */
......
......@@ -791,6 +791,12 @@ int finsh_system_init(void)
rt_err_t result = RT_EOK;
rt_thread_t tid;
if(shell)
{
rt_kprintf("finsh shell already init.\n");
return RT_EOK;
}
#ifdef FINSH_USING_SYMTAB
#ifdef __CC_ARM /* ARM C Compiler */
extern const int FSymTab$$Base;
......
......@@ -136,11 +136,19 @@ static void tcpip_init_done_callback(void *arg)
* LwIP system initialization
*/
extern int eth_system_device_init_private(void);
static volatile uint8_t init_ok = 0;
int lwip_system_init(void)
{
rt_err_t rc;
struct rt_semaphore done_sem;
if(init_ok)
{
rt_kprintf("lwip system already init.\n");
return 0;
}
init_ok = 1;
eth_system_device_init_private();
/* set default netif to NULL */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册