提交 730981ec 编写于 作者: armink_ztl's avatar armink_ztl

[components] Update dfs and lwIP 2.0.2 re-initialization process.

上级 60435316
......@@ -55,15 +55,15 @@ 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)
static rt_bool_t init_ok = RT_FALSE;
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));
......@@ -92,6 +92,8 @@ int dfs_init(void)
}
#endif
init_ok = RT_TRUE;
return 0;
}
INIT_PREV_EXPORT(dfs_init);
......
......@@ -136,18 +136,17 @@ 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;
static rt_bool_t init_ok = RT_FALSE;
if(init_ok)
if (init_ok)
{
rt_kprintf("lwip system already init.\n");
return 0;
}
init_ok = 1;
eth_system_device_init_private();
......@@ -189,6 +188,8 @@ int lwip_system_init(void)
#endif
rt_kprintf("lwIP-%d.%d.%d initialized!\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION);
init_ok = RT_TRUE;
return 0;
}
INIT_PREV_EXPORT(lwip_system_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册