chenxuuu 3 лет назад
Родитель
Сommit
960aa1e597
34 измененных файлов с 78 добавлено и 45 удалено
  1. 1 0
      components/camera/luat_lib_camera.c
  2. 1 0
      components/coremark/luat_lib_coremark.c
  3. 4 3
      components/eink/luat_lib_eink.c
  4. 2 1
      components/flashdb/src/luat_lib_fdb.c
  5. 2 1
      components/gtfont/luat_lib_gtfont.c
  6. 1 0
      components/io_queue/luat_lib_io_queue.c
  7. 16 15
      components/iotauth/luat_lib_iotauth.c
  8. 3 2
      components/lcd/luat_lib_lcd.c
  9. 1 0
      components/lora/luat_lib_lora.c
  10. 2 1
      components/lua-cjson/lua_cjson.c
  11. 1 0
      components/luatfonts/luat_lib_fonts.c
  12. 2 0
      components/lvgl/binding/luat_lib_lvgl_anim.c
  13. 8 7
      components/minmea/luat_lib_libgnss.c
  14. 1 0
      components/network/httpsrv/src/luat_lib_httpsrv.c
  15. 2 1
      components/network/libhttp/luat_lib_http.c
  16. 1 0
      components/u8g2/luat_lib_disp.c
  17. 4 3
      lua/src/liolib.c
  18. 1 0
      luat/modules/luat_lib_adc.c
  19. 2 1
      luat/modules/luat_lib_crypto.c
  20. 1 0
      luat/modules/luat_lib_dac.c
  21. 1 0
      luat/modules/luat_lib_fota.c
  22. 1 0
      luat/modules/luat_lib_fs.c
  23. 1 0
      luat/modules/luat_lib_gpio.c
  24. 1 0
      luat/modules/luat_lib_i2c.c
  25. 1 0
      luat/modules/luat_lib_i2s.c
  26. 1 0
      luat/modules/luat_lib_ir.c
  27. 3 2
      luat/modules/luat_lib_keyboard.c
  28. 1 0
      luat/modules/luat_lib_lcdseg.c
  29. 3 2
      luat/modules/luat_lib_libcoap.c
  30. 1 0
      luat/modules/luat_lib_log.c
  31. 4 3
      luat/modules/luat_lib_lpmem.c
  32. 1 0
      luat/modules/luat_lib_mcu.c
  33. 2 2
      script/turnkey/eink-calendar/main.lua
  34. 1 1
      tools/make_doc_file.py

+ 1 - 0
components/camera/luat_lib_camera.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2022.01.11
 @demo camera
+@tag LUAT_USE_CAMERA
 */
 #include "luat_base.h"
 #include "luat_camera.h"

+ 1 - 0
components/coremark/luat_lib_coremark.c

@@ -3,6 +3,7 @@
 @summary 跑分
 @version 1.0
 @date    2022.01.11
+@tag LUAT_USE_COREMARK
 */
 #include "luat_base.h"
 

+ 4 - 3
components/eink/luat_lib_eink.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2020.11.14
 @demo eink
+@tag LUAT_USE_EINK
 */
 #include "luat_base.h"
 #include "luat_log.h"
@@ -500,7 +501,7 @@ static int l_eink_print(lua_State *L)
     int y           = luaL_checkinteger(L, 2);
     const char *str = luaL_checklstring(L, 3, &len);
 
-    
+
     if (check_init() == 0) {
       return 0;
     }
@@ -553,7 +554,7 @@ static int l_eink_show(lua_State *L)
     /* Display the frame_buffer */
     //EPD_SetFrameMemory(&epd, frame_buffer, x, y, Paint_GetWidth(&ctxs[ctx_index]->paint), Paint_GetHeight(&ctxs[ctx_index]->paint));
     //EPD_DisplayFrame(&epd);
-    
+
     if (check_init() == 0) {
       return 0;
     }
@@ -641,7 +642,7 @@ static int l_eink_rect(lua_State *L)
     int y2      = luaL_checkinteger(L, 4);
     int colored = luaL_optinteger(L, 5, 0);
     int fill    = luaL_optinteger(L, 6, 0);
-  
+
     if (check_init() == 0) {
       return 0;
     }

+ 2 - 1
components/flashdb/src/luat_lib_fdb.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2021.11.03
 @demo fdb
+@tag LUAT_USE_FDB
 */
 
 #include "luat_base.h"
@@ -212,7 +213,7 @@ static int l_fdb_kv_get(lua_State *L) {
     blob.buf = buff.b;
     blob.size = buff.size;
     size_t read_len = fdb_kv_get_blob(kvdb, key, &blob);
-    
+
     lua_Integer *intVal;
     // lua_Number *numVal;
 

+ 2 - 1
components/gtfont/luat_lib_gtfont.c

@@ -3,6 +3,7 @@
 @summary gtfont高通字库模块
 @version 1.0
 @date    2021.11.11
+@tag LUAT_USE_GTFONT
 */
 
 #include "luat_base.h"
@@ -23,7 +24,7 @@ void gtfont_draw_w(unsigned char *pBits,unsigned int x,unsigned int y,unsigned i
 	unsigned int i,j,k,n;
 	unsigned char temp;
 	n = 0;
-	
+
 	for( i = 0;i < high; i++){
 		for( j = 0;j < ((widt+7)>> 3);j++){
 			temp = pBits[n++];

+ 1 - 0
components/io_queue/luat_lib_io_queue.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2022.03.13
 @demo io_queue
+@tag LUAT_USE_IO_QUEUE
 */
 #include "luat_base.h"
 #include "luat_multimedia.h"

+ 16 - 15
components/iotauth/luat_lib_iotauth.c

@@ -5,6 +5,7 @@
 @version core V0007
 @date    2022.08.06
 @demo iotauth
+@tag LUAT_USE_IOTAUTH
 */
 #include "luat_base.h"
 #include "luat_crypto.h"
@@ -87,9 +88,9 @@ static void aliyun_token(const char* product_key,const char* device_name,const c
 /*
 阿里云物联网平台三元组生成
 @api iotauth.aliyun(product_key, device_name,device_secret,method,cur_timestamp)
-@string product_key 
-@string device_name 
-@string device_secret 
+@string product_key
+@string device_name
+@string device_secret
 @string method 加密方式,"hmacmd5" "hmacsha1" "hmacsha256" 可选,默认"hmacsha256"
 @number cur_timestamp 可选
 @return string mqtt三元组 client_id
@@ -209,9 +210,9 @@ static void onenet_token(const char* product_id,const char* device_name,const ch
 /*
 中国移动物联网平台三元组生成
 @api iotauth.onenet(produt_id, device_name,key,method,cur_timestamp,version)
-@string produt_id 
-@string device_name 
-@string key 
+@string produt_id
+@string device_name
+@string key
 @string method 加密方式,"md5" "sha1" "sha256" 可选,默认"md5"
 @number cur_timestamp 可选
 @string version 可选 默认"2018-10-31"
@@ -253,8 +254,8 @@ static void iotda_token(const char* device_id,const char* device_secret,long lon
 /*
 华为物联网平台三元组生成
 @api iotauth.iotda(device_id,device_secret,ins_timestamp,cur_timestamp)
-@string device_id 
-@string device_secret 
+@string device_id
+@string device_secret
 @number ins_timestamp 是否校验时间戳 1:校验 0:不校验
 @number cur_timestamp 可选
 @return string mqtt三元组 client_id
@@ -335,9 +336,9 @@ static void qcloud_token(const char* product_id,const char* device_name,const ch
 /*
 腾讯联网平台三元组生成
 @api iotauth.qcloud(product_id, device_name,device_secret,method,cur_timestamp,sdk_appid)
-@string product_id 
-@string device_name 
-@string device_secret 
+@string product_id
+@string device_name
+@string device_secret
 @string method 加密方式,"sha1" "sha256" 可选,默认"sha256"
 @number cur_timestamp 可选
 @string sdk_appid 可选 默认为"12010126"
@@ -383,7 +384,7 @@ static void tuya_token(const char* device_id,const char* device_secret,long long
 涂鸦联网平台三元组生成
 @api iotauth.tuya(device_id,device_secret,cur_timestamp)
 @string device_id
-@string device_secret 
+@string device_secret
 @number cur_timestamp 可选
 @return string mqtt三元组 client_id
 @return string mqtt三元组 user_name
@@ -432,9 +433,9 @@ static void baidu_token(const char* iot_core_id,const char* device_key,const cha
 /*
 百度物联网平台三元组生成
 @api iotauth.baidu(iot_core_id, device_key,device_secret,method,cur_timestamp)
-@string iot_core_id 
-@string device_key 
-@string device_secret 
+@string iot_core_id
+@string device_key
+@string device_secret
 @string method 加密方式,"MD5" "SHA256" 可选,默认"MD5"
 @number cur_timestamp 可选
 @return string mqtt三元组 client_id

+ 3 - 2
components/lcd/luat_lib_lcd.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2021.06.16
 @demo lcd
+@tag LUAT_USE_LCD
 */
 #include "luat_base.h"
 #include "luat_lcd.h"
@@ -1590,7 +1591,7 @@ static const int l_lcd_draw_utf8(lua_State *L) {
             luat_lcd_draw(default_conf, draw_x, y, draw_x + desc.char_w - 1, y + font->line_height - 1, buff);
           //}
           //else {
-          // 
+          //
           //}
         }
     }
@@ -1598,7 +1599,7 @@ static const int l_lcd_draw_utf8(lua_State *L) {
       luat_heap_free(buff);
 
     lcd_auto_flush(default_conf);
-    lua_pushinteger(L, draw_x + desc.char_w);  
+    lua_pushinteger(L, draw_x + desc.char_w);
     return 1;
 }
 #endif

+ 1 - 0
components/lora/luat_lib_lora.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2022.06.24
 @demo lora
+@tag LUAT_USE_LORA
 */
 
 #include "luat_base.h"

+ 2 - 1
components/lua-cjson/lua_cjson.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2020.02.18
 @demo json
+@tag LUAT_USE_CJSON
 */
 /* Lua CJSON - JSON support for Lua
  *
@@ -709,7 +710,7 @@ static int json_encode(lua_State *l)
 
     luaL_argcheck(l, lua_gettop(l) == 1, 1, "expected 1 argument");
 
-    
+
     encode_buf = &local_encode_buf;
     ret = strbuf_init(encode_buf, 0);
     if (ret) {

+ 1 - 0
components/luatfonts/luat_lib_fonts.c

@@ -3,6 +3,7 @@
 @summary 字体库
 @version 1.0
 @date    2022.07.11
+@tag LUAT_USE_FONTS
 */
 
 #include "luat_base.h"

+ 2 - 0
components/lvgl/binding/luat_lib_lvgl_anim.c

@@ -3,6 +3,8 @@
 @summary LVGL图像库
 @version 1.0
 @date    2021.06.01
+@demo lvgl
+@tag LUAT_USE_LVGL
 */
 
 #include "luat_base.h"

+ 8 - 7
components/minmea/luat_lib_libgnss.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2020.07.03
 @demo libgnss
+@tag LUAT_USE_LIBGNSS
 */
 #include "luat_base.h"
 #include "luat_msgbus.h"
@@ -41,7 +42,7 @@ static int luat_libgnss_init(lua_State *L) {
             LLOGW("out of memory for libgnss data parse");
             return 0;
         }
-        gnsstmp = luat_heap_malloc(sizeof(luat_libgnss_t)); 
+        gnsstmp = luat_heap_malloc(sizeof(luat_libgnss_t));
         if (gnsstmp == NULL) {
             luat_heap_free(gnss);
             LLOGW("out of memory for libgnss data parse");
@@ -62,7 +63,7 @@ static int parse_nmea(const char* line, lua_State *L) {
     if (gnss == NULL && luat_libgnss_init(L)) {
         return 0;
     }
-    
+
     switch (minmea_sentence_id(line, false)) {
         case MINMEA_SENTENCE_RMC: {
             if (minmea_parse_rmc(&(gnsstmp->frame_rmc), line)) {
@@ -206,7 +207,7 @@ static int l_libgnss_parse(lua_State *L) {
             prev = i;
         }
     }
-    
+
     return 0;
 }
 
@@ -265,7 +266,7 @@ static int l_libgnss_get_rmc(lua_State *L) {
     lua_createtable(L, 0, 12);
 
     if (gnss != NULL) {
-        
+
         lua_pushliteral(L, "valid");
         lua_pushboolean(L, gnss->frame_rmc.valid);
         lua_settable(L, -3);
@@ -346,7 +347,7 @@ static int l_libgnss_get_gsv(lua_State *L) {
                 if (gnss->frame_gsv[i].sats[j].snr) {
                     lua_pushinteger(L, count++);
                     lua_createtable(L, 0, 3);
-                    
+
                     lua_pushliteral(L, "snr");
                     lua_pushinteger(L, gnss->frame_gsv[i].sats[j].snr);
                     lua_settable(L, -3);
@@ -412,7 +413,7 @@ static int l_libgnss_get_gsa(lua_State *L) {
             lua_settable(L, -3);
         }
     }
-    
+
     lua_settable(L, -3);
 
     return 1;
@@ -519,7 +520,7 @@ static int l_libgnss_debug(lua_State *L) {
     {
         gnss->debug = 0;
     }
-    
+
     return 0;
 }
 

+ 1 - 0
components/network/httpsrv/src/luat_lib_httpsrv.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2022.010.15
 @demo wlan
+@tag LUAT_USE_HTTPSRV
 */
 
 #include "luat_base.h"

+ 2 - 1
components/network/libhttp/luat_lib_http.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2022.09.05
 @demo    socket
+@tag LUAT_USE_HTTP
 */
 
 #include "luat_base.h"
@@ -659,7 +660,7 @@ static int l_http_request(lua_State *L) {
 	}
 	network_init_ctrl(http_ctrl->netc, NULL, luat_lib_http_callback, http_ctrl);
 
-	
+
 	network_set_base_mode(http_ctrl->netc, 1, 10000, 0, 0, 0, 0);
 	network_set_local_port(http_ctrl->netc, 0);
 

+ 1 - 0
components/u8g2/luat_lib_disp.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2020.03.30
 @demo u8g2
+@tag LUAT_USE_DISP
 */
 #include "luat_base.h"
 #include "luat_malloc.h"

+ 4 - 3
lua/src/liolib.c

@@ -3,6 +3,7 @@
 @summary io操作(扩展)
 @version 1.0
 @date    2020.07.03
+@tag LUAT_CONF_BSP
 */
 
 #define liolib_c
@@ -755,7 +756,7 @@ static int f_flush (lua_State *L) {
 @string 文件路径
 @return bool 存在返回true,否则返回false
 @usage
-log.info("io", "file exists", io.exists("/boottime")) 
+log.info("io", "file exists", io.exists("/boottime"))
  */
 static int io_exists (lua_State *L) {
   const char *filename = luaL_checkstring(L, 1);
@@ -781,7 +782,7 @@ static int io_fileSize (lua_State *L) {
   const char *filename = luaL_checkstring(L, 1);
   FILE* f = fopen(filename, "rb");
   if(f == NULL) {
-    lua_pushinteger(L, 0); 
+    lua_pushinteger(L, 0);
   }
   else {
     fseek(f, 0, SEEK_END);
@@ -1115,7 +1116,7 @@ static int io_lsdir (lua_State *L) {
   else if (ret > 0) {
     lua_pushboolean(L, 1);
     lua_createtable(L, ret, 0);
-    
+
     for (size_t i = 0; i < ret; i++)
     {
       lua_createtable(L, 0, 2);

+ 1 - 0
luat/modules/luat_lib_adc.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2020.07.03
 @demo adc
+@tag LUAT_USE_ADC
 */
 #include "luat_base.h"
 #include "luat_adc.h"

+ 2 - 1
luat/modules/luat_lib_crypto.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2020.07.03
 @demo crypto
+@tag LUAT_USE_CRYPTO
 */
 #include "luat_base.h"
 #include "luat_crypto.h"
@@ -288,7 +289,7 @@ int l_crypto_cipher_decrypt(lua_State *L) {
 local crc = crypto.crc16("")
  */
 static int l_crypto_crc16(lua_State *L)
-{   
+{
     size_t inputlen;
     const unsigned char *inputData;
     const char  *inputmethod = (const char*)luaL_checkstring(L, 1);

+ 1 - 0
luat/modules/luat_lib_dac.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2021.12.03
 @demo multimedia
+@tag LUAT_USE_DAC
 */
 
 #include "luat_base.h"

+ 1 - 0
luat/modules/luat_lib_fota.c

@@ -5,6 +5,7 @@
 @version core V0007
 @date    2022.05.26
 @demo ota
+@tag LUAT_USE_FOTA
 */
 #include "luat_base.h"
 #include "luat_fota.h"

+ 1 - 0
luat/modules/luat_lib_fs.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2021.03.30
 @demo fs
+@tag LUAT_USE_FS
 */
 #include "luat_base.h"
 #include "luat_fs.h"

+ 1 - 0
luat/modules/luat_lib_gpio.c

@@ -7,6 +7,7 @@
 @date    2020.03.30
 @demo gpio
 @video https://www.bilibili.com/video/BV1hr4y1p7dt
+@tag LUAT_USE_GPIO
 */
 #include "luat_base.h"
 #include "luat_gpio.h"

+ 1 - 0
luat/modules/luat_lib_i2c.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2020.03.30
 @demo i2c
+@tag LUAT_USE_I2C
 */
 #include "luat_base.h"
 #include "luat_log.h"

+ 1 - 0
luat/modules/luat_lib_i2s.c

@@ -3,6 +3,7 @@
 @summary 数字音频
 @version core V0007
 @date    2022.05.26
+@tag LUAT_USE_I2S
 */
 #include "luat_base.h"
 #include "luat_malloc.h"

+ 1 - 0
luat/modules/luat_lib_ir.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2021.10.26
 @demo ir
+@tag LUAT_USE_IR
 */
 #include "luat_base.h"
 #include "luat_gpio.h"

+ 3 - 2
luat/modules/luat_lib_keyboard.c

@@ -5,6 +5,7 @@
 @version 1.0
 @date    2021.11.24
 @demo keyboard
+@tag LUAT_USE_KEYBOARD
 */
 
 #include "luat_base.h"
@@ -84,7 +85,7 @@ static int l_keyboard_init(lua_State *L) {
     conf.debounce = luaL_optinteger(L, 4, 1);
     conf.cb = l_keyboard_irq_cb;
     int ret = luat_keyboard_init(&conf);
-    
+
     lua_pushboolean(L, ret == 0 ? 1 : 0);
     return 1;
 }
@@ -97,7 +98,7 @@ static int l_keyboard_deinit(lua_State *L) {
     conf.debounce = luaL_optinteger(L, 4, 1);
 
     int ret = luat_keyboard_deinit(&conf);
-    
+
     lua_pushboolean(L, ret == 0 ? 1 : 0);
     return 1;
 }

+ 1 - 0
luat/modules/luat_lib_lcdseg.c

@@ -3,6 +3,7 @@
 @summary 段式lcd
 @version 1.0
 @date    2021.10.22
+@tag LUAT_USE_LCDSEG
 */
 
 #include "luat_base.h"

+ 3 - 2
luat/modules/luat_lib_libcoap.c

@@ -4,6 +4,7 @@
 @version 1.0
 @date    2020.06.30
 @demo libcoap
+@tag LUAT_USE_COAP
 */
 #include "luat_base.h"
 #include "luat_timer.h"
@@ -220,7 +221,7 @@ static int l_libcoap_parse(lua_State* L) {
             else if (opt_header->opt_len == 13) {
                 opt_header->opt_len += (unsigned int)(*(ptr+1));
             }
-            
+
             ptr += opt_header->opt_len + 1;
             idx += opt_header->opt_len + 1;
             _coap->optSize += opt_header->opt_len + 1;
@@ -228,7 +229,7 @@ static int l_libcoap_parse(lua_State* L) {
         LLOGD("opt size=%d", _coap->optSize);
         memcpy(_coap->opt, ptr - _coap->optSize, _coap->optSize);
     }
-    
+
 
     // 分析一下data
     if (idx < len) {

+ 1 - 0
luat/modules/luat_lib_log.c

@@ -4,6 +4,7 @@
 @summary 日志库
 @version 1.0
 @date    2020.03.30
+@tag LUAT_CONF_BSP
 */
 #include "luat_base.h"
 #include "luat_sys.h"

+ 4 - 3
luat/modules/luat_lib_lpmem.c

@@ -4,6 +4,7 @@
 @summary 操作低功耗不掉电内存块
 @version V0002
 @date    2020.07.10
+@tag LUAT_USE_LPMEM
 */
 
 #include "luat_base.h"
@@ -18,7 +19,7 @@
 @int 内存偏移量
 @int 读取大小,单位字节
 @return string 读取成功返回字符串,否则返回nil
-@usage  
+@usage
 -- 读取1kb的内存
 local data = lpmem.read(0, 1024)
 */
@@ -43,7 +44,7 @@ static int l_lpmem_read(lua_State *L) {
 @int 内存偏移量
 @string 待写入的数据
 @return boolean 成功返回true,否则返回false
-@usage  
+@usage
 -- 往偏移量为512字节的位置, 写入数据
 lpmem.write(512, data)
 */
@@ -66,7 +67,7 @@ static int l_lpmem_write(lua_State *L) {
 获取内存块的总大小
 @api    lpmem.size()
 @return int 内存块的大小
-@usage  
+@usage
 lpmem.size()
 */
 static int l_lpmem_size(lua_State *L) {

+ 1 - 0
luat/modules/luat_lib_mcu.c

@@ -4,6 +4,7 @@
 @summary 封装mcu一些特殊操作
 @version core V0007
 @date    2021.08.18
+@tag LUAT_USE_MCU
 */
 #include "luat_base.h"
 #include "luat_mcu.h"

+ 2 - 2
script/turnkey/eink-calendar/main.lua

@@ -9,11 +9,11 @@ require("sysplus")
 
 --需要自行填写的东西
 --wifi信息
-local wifiName,wifiPassword = "wifi","password"
+local wifiName,wifiPassword = "Xiaomi_AX6000","Air123456"
 --地区id,请前往https://api.luatos.org/luatos-calendar/v1/check-city/ 查询自己所在位置的id
 local location = "101020100"
 --天气接口信息,需要自己申请,具体参数请参考https://api.luatos.org/ 页面上的描述
-local appid,appsecret = "appid(要改)","appsecret(要改)"
+local appid,appsecret = "27548549","3wdKWuRZ"
 
 local function connectWifi()
     log.info("wlan", "wlan_init:", wlan.init())

+ 1 - 1
tools/make_doc_file.py

@@ -18,7 +18,7 @@ for bsp in bsp_header_list:
 def get_tags(tag):
     r = []
     for bsp in bsp_header_list:
-        if bsp["url"].find(" "+tag) >= 0:
+        if bsp["url"].find(" "+tag+" ") >= 0:
             r.append("{bdg-primary}`" + bsp["name"] + "`")
     return " ".join(r)