Browse Source

fix: 路径不用单独搞

chenxuuu 3 years ago
parent
commit
127d8e1fb9
2 changed files with 6 additions and 6 deletions
  1. 0 3
      script/turnkey/lcd-0.96-lvgl/device.lua
  2. 6 3
      script/turnkey/lcd-0.96-lvgl/main.lua

+ 0 - 3
script/turnkey/lcd-0.96-lvgl/device.lua

@@ -7,7 +7,6 @@ if not pin then pin = {} end
 --LuatOS-SoC_V0006_air101 长这样
 local chips = {
     air101 = {
-        path = "/luadb/",
         useFont = true,
         spi = 0,
         spiCS = pin.PB04,
@@ -22,7 +21,6 @@ local chips = {
         keyO = pin.PA4,
     },
     air105 = {
-        path = "/luadb/",
         useFont = true,
         spi = 5,
         spiCS = pin.PC14,
@@ -37,7 +35,6 @@ local chips = {
         keyO = pin.PE7,
     },
     esp32c3 = {
-        path = "/spiffs/",
         useFont = false,
         spi = 2,
         spiCS = 7,

+ 6 - 3
script/turnkey/lcd-0.96-lvgl/main.lua

@@ -16,9 +16,12 @@ log.info("lvgl", lvgl.init())
 scr = lvgl.obj_create(nil, nil)
 
 if device.useFont then
-    local font_16 = lvgl.font_load(device.path.."16_test_fonts.bin")
-    assert(font_16,"font not found")
-    lvgl.obj_set_style_local_text_font(scr, lvgl.LABEL_PART_MAIN, lvgl.STATE_DEFAULT, font_16)
+    local font_16 = lvgl.font_load("/luadb/16_test_fonts.bin")
+    if not font_16 then
+        log.info("font error","font not found")
+    else
+        lvgl.obj_set_style_local_text_font(scr, lvgl.LABEL_PART_MAIN, lvgl.STATE_DEFAULT, font_16)
+    end
 end
 
 home = require"home"