Kaynağa Gözat

update: wifi和ble同时用的场景,增加配置项来控制, 默认不开, 还原lua内存大小

Wendal Chen 1 yıl önce
ebeveyn
işleme
b1a21bf9fa

+ 7 - 0
cloudbuild/esp32c3-idf5.meta.json

@@ -246,6 +246,13 @@
                   "rsize": 0,
                   "fsize": 371408,
                   "dft": false
+               },
+               {
+                  "name": "LUAT_CONF_WIFI_AND_BLE",
+                  "content": "需要同时使用wifi和ble,这个配置项会减少lua内存,增加sys内存",
+                  "rsize": 1024,
+                  "fsize": 371408,
+                  "dft": false
                }
             ]
          },

+ 13 - 7
luatos/components/luat/port/luat_malloc_idf5.c

@@ -15,17 +15,23 @@
 
 //-----------------------------------------------------------------------------
 #ifndef LUAT_HEAP_SIZE
+
 #if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
-#if defined(LUAT_USE_NIMBLE) || defined(LUAT_USE_TLS)
-#define LUAT_HEAP_SIZE (72*1024)
-#else
-#define LUAT_HEAP_SIZE (112*1024)
-#endif
+    #if defined(LUAT_USE_NIMBLE) || defined(LUAT_USE_TLS)
+        #if LUAT_CONF_WIFI_AND_BLE
+            #define LUAT_HEAP_SIZE (72*1024)
+        #else
+            #define LUAT_HEAP_SIZE (92*1024)
+        #endif
+    #else
+        #define LUAT_HEAP_SIZE (112*1024)
+    #endif
 #elif defined(CONFIG_IDF_TARGET_ESP32C2)
-#define LUAT_HEAP_SIZE (68*1024)
+    #define LUAT_HEAP_SIZE (68*1024)
 #else
-#define LUAT_HEAP_SIZE (64*1024)
+    #define LUAT_HEAP_SIZE (64*1024)
 #endif
+
 #endif // LUAT_HEAP_SIZE
 
 static uint8_t vmheap[LUAT_HEAP_SIZE];