Forráskód Böngészése

add: 添加repl库的支持

Wendal Chen 2 éve
szülő
commit
45dab0df9b
6 módosított fájl, 110 hozzáadás és 33 törlés
  1. 1 1
      app/main.c
  2. 3 0
      app/port/luat_base_air101.c
  3. 51 16
      cloudbuild/air101.meta.json
  4. 50 15
      cloudbuild/air103.meta.json
  5. 1 1
      platform/sys/wm_main.c
  6. 4 0
      xmake.lua

+ 1 - 1
app/main.c

@@ -157,7 +157,7 @@ void UserMain(void){
 	// rst_sta = tls_reg_read32(HR_CLK_RST_STA);
 	// tls_reg_write32(HR_CLK_RST_STA, 0xFF);
 
-#ifdef LUAT_USE_SHELL
+#if defined(LUAT_USE_SHELL) || defined(LUAT_USE_REPL)
 	luat_shell_poweron(0);
 #endif
 

+ 3 - 0
app/port/luat_base_air101.c

@@ -228,6 +228,9 @@ static const luaL_Reg loadedlibs[] = {
 #endif
 #ifdef LUAT_USE_PROFILER
   {"profiler", luaopen_profiler},
+#endif
+#ifdef LUAT_USE_REPL
+  {"repl", luaopen_repl},
 #endif
   // {"opus", luaopen_opus},
   {NULL, NULL}

+ 51 - 16
cloudbuild/air101.meta.json

@@ -42,21 +42,6 @@
             ]
         },
         "component": [
-            {
-                "icon": "zmdi-input-composite",
-                "name": "@Basic",
-                "content": "基础配置",
-                "rsize": 0,
-                "children": [
-                    {
-                        "name": "LUAT_CONF_VM_64bit",
-                        "content": "64bit虚拟机,默认为32bit.",
-                        "rsize": 193240,
-                        "fsize": 1024,
-                        "dft": false
-                    }
-                ]
-            },
             {
                 "icon": "zmdi-input-composite",
                 "name": "@DEV",
@@ -217,6 +202,13 @@
                 "content": "工具库",
                 "rsize": 0,
                 "children": [
+                    {
+                        "name": "repl",
+                        "content": "REPL(读取-解析-执行)循环",
+                        "rsize": 10908,
+                        "fsize": 284260,
+                        "dft": false
+                    },
                     {
                         "name": "cjson",
                         "content": "JSON序列化与反序列化",
@@ -268,7 +260,7 @@
                     },
                     {
                         "name": "shell",
-                        "content": "控制台,搭配dbg功能才可以在LuatIDE使用",
+                        "content": "控制台,与repl会冲突!!",
                         "rsize": 6848,
                         "fsize": 372224,
                         "dft": false,
@@ -398,6 +390,49 @@
                 "fsize": 271352,
                 "dft": false
             },
+            {
+                "icon": "zmdi-input-composite",
+                "name": "@EXTS2",
+                "content": "高级配置",
+                "rsize": 0,
+                "children": [
+                    {
+                        "name": "@exts_comments",
+                        "content": "本节均为高级配置,慎选",
+                        "rsize": 193240,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_CONF_VM_64bit",
+                        "content": "64bit虚拟机,默认为32bit.",
+                        "rsize": 193240,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_FS_SIZE_112K",
+                        "content": "文件系统调整到112k,默认48k,非脚本区大小",
+                        "rsize": 64000,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_FS_SIZE_176K",
+                        "content": "文件系统调整到176k,默认48k,非脚本区大小",
+                        "rsize": 128000,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_FS_SIZE_240K",
+                        "content": "文件系统调整到240k,默认48k,非脚本区大小",
+                        "rsize": 192000,
+                        "fsize": 1024,
+                        "dft": false
+                    }
+                ]
+            },
             {
                 "icon": "zmdi-puzzle-piece",
                 "name": "@EXT",

+ 50 - 15
cloudbuild/air103.meta.json

@@ -42,21 +42,6 @@
             ]
         },
         "component": [
-            {
-                "icon": "zmdi-input-composite",
-                "name": "@Basic",
-                "content": "基础配置",
-                "rsize": 0,
-                "children": [
-                    {
-                        "name": "LUAT_CONF_VM_64bit",
-                        "content": "64bit虚拟机,默认为32bit.",
-                        "rsize": 193240,
-                        "fsize": 1024,
-                        "dft": false
-                    }
-                ]
-            },
             {
                 "icon": "zmdi-input-composite",
                 "name": "@DEV",
@@ -211,12 +196,62 @@
                 "fsize": 271352,
                 "dft": false
             },
+            {
+                "icon": "zmdi-input-composite",
+                "name": "@EXTS2",
+                "content": "高级配置",
+                "rsize": 0,
+                "children": [
+                    {
+                        "name": "@exts_comments",
+                        "content": "本节均为高级配置,慎选",
+                        "rsize": 193240,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_CONF_VM_64bit",
+                        "content": "64bit虚拟机,默认为32bit.",
+                        "rsize": 193240,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_FS_SIZE_112K",
+                        "content": "文件系统调整到112k,默认48k,非脚本区大小",
+                        "rsize": 64000,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_FS_SIZE_176K",
+                        "content": "文件系统调整到176k,默认48k,非脚本区大小",
+                        "rsize": 128000,
+                        "fsize": 1024,
+                        "dft": false
+                    },
+                    {
+                        "name": "LUAT_FS_SIZE_240K",
+                        "content": "文件系统调整到240k,默认48k,非脚本区大小",
+                        "rsize": 192000,
+                        "fsize": 1024,
+                        "dft": false
+                    }
+                ]
+            },
             {
                 "icon": "zmdi-card-sd",
                 "name": "@LIB",
                 "content": "工具库",
                 "rsize": 0,
                 "children": [
+                    {
+                        "name": "repl",
+                        "content": "REPL(读取-解析-执行)循环",
+                        "rsize": 10908,
+                        "fsize": 284260,
+                        "dft": false
+                    },
                     {
                         "name": "cjson",
                         "content": "JSON序列化与反序列化",

+ 1 - 1
platform/sys/wm_main.c

@@ -244,7 +244,7 @@ int main(void)
     csi_vic_set_wakeup_irq(TIMER_IRQn);
     csi_vic_set_wakeup_irq(WDG_IRQn);
 	/*should be here because main stack will be allocated and deallocated after task delete*/
-	// tls_mem_get_init_available_size();
+	tls_mem_get_init_available_size();
 	
     /*configure wake up source end*/
 	TaskStartStk = tls_mem_alloc(sizeof(u32)*TASK_START_STK_SIZE);

+ 4 - 0
xmake.lua

@@ -561,6 +561,10 @@ target("air10x")
     add_files(luatos.."components/mempool/profiler/**.c")
     add_includedirs(luatos.."components/mempool/profiler/include")
 
+    -- profiler
+    add_files(luatos.."components/repl/**.c")
+    add_includedirs(luatos.."components/repl/")
+
     
     -- local opus_dir = luatos .. "components/opus/"
     -- add_includedirs(opus_dir .. "opus-1.3.1/src",