Wendal Chen 3 роки тому
батько
коміт
56f63ece18
3 змінених файлів з 22 додано та 2 видалено
  1. 3 0
      app/port/luat_base_air101.c
  2. 4 2
      app/port/luat_conf_bsp.h
  3. 15 0
      xmake.lua

+ 3 - 0
app/port/luat_base_air101.c

@@ -193,6 +193,9 @@ static const luaL_Reg loadedlibs[] = {
 #endif
 #ifdef LUAT_USE_LORA
   {"lora", luaopen_lora},
+#endif
+#ifdef LUAT_USE_MINIZ
+  {"miniz", luaopen_miniz},
 #endif
   {NULL, NULL}
 };

+ 4 - 2
app/port/luat_conf_bsp.h

@@ -73,6 +73,8 @@
 #define LUAT_USE_I2CTOOLS 1
 #define LUAT_USE_LORA 1
 #define LUAT_USE_MLX90640 1
+// zlib压缩,更快更小的实现
+#define LUAT_USE_MINIZ 1
 
 //---------------SDIO-FATFS特别配置
 // sdio库对接的是fatfs
@@ -83,8 +85,8 @@
 
 //----------------------------
 // 高通字体, 需配合芯片使用
-#define LUAT_USE_GTFONT 1
-#define LUAT_USE_GTFONT_UTF8
+// #define LUAT_USE_GTFONT 1
+// #define LUAT_USE_GTFONT_UTF8
 
 //----------------------------
 // 高级功能, 其中shell是推荐启用, 除非你打算uart0也读数据

+ 15 - 0
xmake.lua

@@ -182,6 +182,20 @@ target("u8g2")
     set_targetdir("$(buildir)/lib")
 target_end()
 
+target("miniz")
+    set_kind("static")
+    set_plat("cross")
+    set_arch("c-sky")
+
+    add_files(luatos.."components/miniz/*.c")
+    add_includedirs("app/port")
+    add_includedirs("include")
+    add_includedirs(luatos.."lua/include")
+    add_includedirs(luatos.."luat/include")
+    add_includedirs(luatos.."components/miniz")
+    set_targetdir("$(buildir)/lib")
+target_end()
+
 target("air10x")
     -- set kind
     set_kind("binary")
@@ -194,6 +208,7 @@ target("air10x")
         AIR10X_VERSION = conf_data:match("#define LUAT_BSP_VERSION \"(%w+)\"")
         local LVGL_CONF = conf_data:find("\r#define LUAT_USE_LVGL") or conf_data:find("\n#define LUAT_USE_LVGL")
         if LVGL_CONF then target:add("deps", "lvgl") end
+        target:add("deps", "miniz")
         local custom_data = io.readfile("$(projectdir)/app/port/luat_conf_bsp.h")
         local TARGET_CONF = custom_data:find("#define AIR101")
         if TARGET_CONF == nil then TARGET_NAME = "AIR103" else TARGET_NAME = "AIR101" end