Bläddra i källkod

fix: 随机数生成器不可用,然后把main.c改名,最后是启用LUAT_COMPILER_NOWEAK宏

Wendal Chen 3 år sedan
förälder
incheckning
bb6e4160cf
5 ändrade filer med 15 tillägg och 5 borttagningar
  1. 7 0
      .gitignore
  2. 1 0
      luatos/include/luat_conf_bsp.h
  3. 1 1
      luatos/main/CMakeLists.txt
  4. 2 0
      luatos/main/idf5_main.c
  5. 4 4
      luatos/makesoc.py

+ 7 - 0
.gitignore

@@ -49,3 +49,10 @@ modules.order
 Module.symvers
 Mkfile.old
 dkms.conf
+build/
+luatos/sdkconfig
+luatos/sdkconfig.old
+luatos/build
+luatos/*.soc
+luatos/.vscode
+.vscode

+ 1 - 0
luatos/include/luat_conf_bsp.h

@@ -6,6 +6,7 @@
 
 #define LUAT_USE_FS_VFS 1
 #define LUAT_USE_VFS_INLINE_LIB 1
+#define LUAT_COMPILER_NOWEAK
 
 // 内存优化: 减少内存消耗, 会稍微减低性能
 // #define LUAT_USE_MEMORY_OPTIMIZATION_CODE_MMAP 1

+ 1 - 1
luatos/main/CMakeLists.txt

@@ -1,3 +1,3 @@
-idf_component_register(SRCS "smartconfig_main.c"
+idf_component_register(SRCS "idf5_main.c"
                     INCLUDE_DIRS ".")
 

+ 2 - 0
luatos/main/smartconfig_main.c → luatos/main/idf5_main.c

@@ -24,9 +24,11 @@
 static uint8_t vmheap[LUAT_HEAP_SIZE];
 
 extern int luat_main (void);
+extern void bootloader_random_enable(void);
 
 void app_main(void)
 {
+    bootloader_random_enable();
     ESP_ERROR_CHECK( nvs_flash_init() );
     bpool(vmheap, LUAT_HEAP_SIZE);
     luat_main();

+ 4 - 4
luatos/makesoc.py

@@ -1,8 +1,8 @@
+#!/usr/bin/python3
+# -*- coding: UTF-8 -*-
 
 import os
-import sys
 import shutil
-import urllib
 import re
 
 bootloader_bin = './build/bootloader/bootloader.bin'
@@ -17,7 +17,7 @@ bsp='ESP32C3'
 cwd_path = os.getcwd()
 if __name__=='__main__':
 
-    fo = open("./include/luat_conf_bsp.h", "r")
+    fo = open("./include/luat_conf_bsp.h", "r", encoding="UTF-8")
     for line in fo.readlines():                          #依次读取每行  
         find_data = re.findall(r'#define LUAT_BSP_VERSION "(.+?)"', line)#[0]
         if find_data:
@@ -37,4 +37,4 @@ if __name__=='__main__':
     shutil.make_archive(out_path+out_file, 'zip', root_dir=pack_path)
     os.rename(out_path+out_file+'.zip',out_file+'.soc')
     
-    print('end')
+    print('done', out_file)