소스 검색

Merge branch 'master' of https://gitee.com/openLuat/LuatOS

alienwalker 3 년 전
부모
커밋
12d091f868
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      components/lcd/luat_lib_lcd.c
  2. 5 2
      script/turnkey/eink-calendar/main.lua

+ 2 - 0
components/lcd/luat_lib_lcd.c

@@ -259,7 +259,9 @@ static int l_lcd_init(lua_State* L) {
         }
         // 初始化OK, 配置额外的参数
         default_conf = conf;
+#ifndef LUAT_USE_LVGL
         u8g2_SetFont(&(conf->luat_lcd_u8g2), u8g2_font_opposansm8);
+#endif
         u8g2_SetFontMode(&(conf->luat_lcd_u8g2), 0);
         u8g2_SetFontDirection(&(conf->luat_lcd_u8g2), 0);
         lua_pushboolean(L, 1);

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

@@ -12,13 +12,13 @@ local wifiName,wifiPassword = "wifi","password"
 --地区id,请前往https://api.luatos.org/luatos-calendar/v1/check-city/ 查询自己所在位置的id
 local location = "101020100"
 --天气接口信息,需要自己申请,具体参数请参考https://api.luatos.org/ 页面上的描述
-local appid,appsecret = "27548549","rEi9nRak"
+local appid,appsecret = "appid(要改)","appsecret(要改)"
 
 local function connectWifi()
     log.info("wlan", "wlan_init:", wlan.init())
 
     wlan.setMode(wlan.STATION)
-    wlan.connect(wifiName,wifiPassword)
+    wlan.connect(wifiName,wifiPassword,1)
 
     -- 等待连上路由,此时还没获取到ip
     result, _ = sys.waitUntil("WLAN_STA_CONNECTED")
@@ -60,7 +60,9 @@ function refresh()
     log.info("refresh","start!")
     local data
     for i=1,5 do--重试最多五次
+        collectgarbage("collect")
         data = requestHttp()
+        collectgarbage("collect")
         if #data > 100 then
             break
         end
@@ -70,6 +72,7 @@ function refresh()
         log.info("load fail","exit!")
         return
     end
+    collectgarbage("collect")
     eink.model(eink.MODEL_1in54)
     log.info("eink.setup",eink.setup(0, 2,11,10,6,7))
     eink.setWin(200, 200, 2)