Просмотр исходного кода

add: sysp启用pack/json/zbuff/crypto

Wendal Chen 4 лет назад
Родитель
Сommit
124e299711

+ 4 - 4
bsp/sysp/CMakeLists.txt

@@ -53,8 +53,8 @@ add_library(luat ${TOPROOT}/luat/modules/luat_main.c
 
 #-----------------------
 # mbedtls
-#include_directories(${TOPROOT}/components/mbedtls/include)
-#add_subdirectory(${TOPROOT}/components/mbedtls mbedtls.out)
+include_directories(${TOPROOT}/components/mbedtls/include)
+add_subdirectory(${TOPROOT}/components/mbedtls mbedtls.out)
 #-----------------------
 
 #-----------------------
@@ -67,7 +67,7 @@ if( ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${USE_FLAGS}")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${USE_FLAGS}")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${USE_FLAGS}")
-    set(CMAKE_EXECUTABLE_SUFFIX .html)
+    #set(CMAKE_EXECUTABLE_SUFFIX .html)
 else()
     find_package(SDL2 REQUIRED)
     find_package(Freetype REQUIRED)
@@ -78,7 +78,7 @@ add_executable(luatos src/main_sysp.c)
 #add_library(luatos_wasm src/main_sysp.c)
 #target_link_libraries(luat luatos_port lua lvgl SDL2 m)
 #target_link_libraries(luatos_port luat lua lvgl SDL2 m)
-target_link_libraries(luatos luat lua luatos_port cjson lvgl m)
+target_link_libraries(luatos luat lua luatos_port cjson lvgl m mbedtls)
 #target_link_libraries(luatos_wasm luat lua luatos_port cjson m)
 #target_link_libraries(luatos luat lua luatos_port cjson mbedtls lvgl SDL2 m)
 #target_link_libraries(luatos_wasm luat lua luatos_port cjson mbedtls lvgl SDL2 m)

+ 1 - 1
bsp/sysp/include/luat_conf_bsp.h

@@ -21,7 +21,7 @@ unsigned int get_timestamp(void);
 
 #define LUAT_USE_LVGL 1
 #define LV_MEM_CUSTOM 1
-// #define LUAT_LV_DEBUG 1
+#define LUAT_LV_DEBUG 0
 #define LUAT_USE_LVGL_INDEV 1
 
 #define LUAT_USE_LVGL_ARC   //圆弧 无依赖

+ 6 - 6
bsp/sysp/port/luat_base_sysp.c

@@ -30,12 +30,12 @@ static const luaL_Reg loadedlibs[] = {
   {"rtos", luaopen_rtos},             // rtos底层库, 核心功能是队列和定时器
   {"log", luaopen_log},               // 日志库
   {"timer", luaopen_timer},           // 延时库
-  //{"pack", luaopen_pack},             // pack.pack/pack.unpack
-  //{"json", luaopen_cjson},             // json
-  //{"zbuff", luaopen_zbuff},            // 
-  //{"mqttcore", luaopen_mqttcore},      // 
-  //{"libcoap", luaopen_libcoap},        // 
-  //{"crypto", luaopen_crypto},
+  {"pack", luaopen_pack},             // pack.pack/pack.unpack
+  {"json", luaopen_cjson},             // json
+  {"zbuff", luaopen_zbuff},            // 
+  {"mqttcore", luaopen_mqttcore},      // 
+  {"libcoap", luaopen_libcoap},        // 
+  {"crypto", luaopen_crypto},
   {"lvgl", luaopen_lvgl},
   {NULL, NULL}
 };

+ 1 - 1
bsp/sysp/port/luat_crypto_sysp.c

@@ -2,7 +2,7 @@
 #include "luat_base.h"
 #include "luat_crypto.h"
 
-#if 0
+#if 1
 
 #define LUAT_LOG_TAG "crypto"
 #include "luat_log.h"