Browse Source

fix: 启用ble功能后, sys需要更多内存, 需要减少lua vm内存

Wendal Chen 4 years ago
parent
commit
6b0e375cc1
2 changed files with 9 additions and 4 deletions
  1. 2 3
      app/main.c
  2. 7 1
      app/port/luat_nimble.c

+ 2 - 3
app/main.c

@@ -24,10 +24,9 @@
 #include "luat_log.h"
 
 #ifndef LUAT_HEAP_SIZE
-#ifdef LUAT_USE_LVGL
-#define LUAT_HEAP_SIZE (128+48)*1024
+#ifdef LUAT_USE_NIMBLE
+#define LUAT_HEAP_SIZE (128+16)*1024
 #else
-/*非LVGL项目并不需要太多的系统内存*/
 #define LUAT_HEAP_SIZE (128+48)*1024
 #endif
 #endif

+ 7 - 1
app/port/luat_nimble.c

@@ -250,6 +250,12 @@ luat_nimble_deinit(void)
 //----------------------------------------
 // 设置广播数据
 int luat_nimble_gap_adv_set_fields() {
-
+    return -1;
 }
 //----------------------------------------
+
+
+// 发送数据
+int luat_nimble_server_send(int id, char* data, size_t len) {
+    return tls_ble_server_api_send_msg((u8*)data, len);
+}