浏览代码

[shell] add re-initial check.

aozima 7 年之前
父节点
当前提交
e49a29f2dc
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      components/finsh/shell.c

+ 6 - 0
components/finsh/shell.c

@@ -726,6 +726,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;