Selaa lähdekoodia

add: 关联编译fskv库,并默认启用

Wendal Chen 3 vuotta sitten
vanhempi
sitoutus
fe3357b296

+ 2 - 0
luatos/components/luat/CMakeLists.txt

@@ -72,6 +72,7 @@ idf_component_register(SRC_DIRS ${LUATOS_ROOT}/luat/modules
                                 ${LUATOS_ROOT}/components/network/posix
                                 ${LUATOS_ROOT}/components/network/websocket
                                 ${LUATOS_ROOT}/components/luatfonts
+                                ${LUATOS_ROOT}/components/fskv
                     INCLUDE_DIRS ../../include
                                 ${LUATOS_ROOT}/lua/include
                                 ${LUATOS_ROOT}/luat/include
@@ -121,6 +122,7 @@ idf_component_register(SRC_DIRS ${LUATOS_ROOT}/luat/modules
                                 ${LUATOS_ROOT}/components/network/posix
                                 ${LUATOS_ROOT}/components/network/websocket
                                 ${LUATOS_ROOT}/components/luatfonts
+                                ${LUATOS_ROOT}/components/fskv
                     REQUIRES esp-tls lwip esp_http_client mbedtls spiffs driver heap esp_netif esp_event
                              esp_wifi esp_rom http_parser mqtt esp_adc bt console spi_flash esp_psram 
                     )

+ 7 - 0
luatos/components/luat/port/luat_base_idf5.c

@@ -153,6 +153,13 @@ static const luaL_Reg loadedlibs[] = {
 #ifdef LUAT_USE_GTFONT
   {"gtfont",    luaopen_gtfont},
 #endif
+#ifdef LUAT_USE_FSKV
+  {"fskv", luaopen_fskv},
+// 启用FSKV的时候,自动禁用FDB
+#ifdef LUAT_USE_FDB
+#undef LUAT_USE_FDB
+#endif
+#endif
 #ifdef LUAT_USE_FDB
   {"fdb",       luaopen_fdb},
 #endif

+ 3 - 1
luatos/include/luat_conf_bsp.h

@@ -69,7 +69,9 @@
 #define LUAT_USE_COREMARK 1
 #define LUAT_USE_IR 1
 // FDB 提供kv数据库, 与nvm库类似
-#define LUAT_USE_FDB 1
+// #define LUAT_USE_FDB 1
+// FSKV库提供fdb库的兼容API, 目标是替代fdb库
+#define LUAT_USE_FSKV 1
 #define LUAT_USE_OTA 1
 #define LUAT_USE_I2CTOOLS 1
 #define LUAT_USE_LORA 1