Pārlūkot izejas kodu

fix:lcd一些参数栈未弹出
add:添加hsync

Dozingfiretruck 1 gadu atpakaļ
vecāks
revīzija
d717169399
2 mainītis faili ar 37 papildinājumiem un 6 dzēšanām
  1. 5 2
      components/lcd/luat_lcd.h
  2. 32 4
      components/lcd/luat_lib_lcd.c

+ 5 - 2
components/lcd/luat_lcd.h

@@ -92,9 +92,12 @@ typedef struct luat_lcd_conf {
     uint8_t bpp;			//颜色bit,默认是RGB565 16bit,预留兼容ARGB888 32bit
     uint32_t flush_rate;	//刷新率,针对no ram的屏幕起效
     uint32_t bus_speed;
-    uint16_t vfp;
+    uint16_t hbp;
+    uint16_t hspw;
+    uint16_t hfp;
     uint16_t vbp;
-    uint16_t vs;
+    uint16_t vspw;
+    uint16_t vfp;
     uint8_t tp_driver_id;
     uint8_t tp_pin_rst;
     uint8_t tp_pin_irq;

+ 32 - 4
components/lcd/luat_lib_lcd.c

@@ -299,25 +299,53 @@ static int l_lcd_init(lua_State* L) {
             if (LUA_TNUMBER == lua_gettable(L, 2)) {
                 conf->interface_mode = luaL_checkinteger(L, -1);
             }
+            lua_pop(L, 1);
+
             lua_pushstring(L, "bus_speed");
             if (LUA_TNUMBER == lua_gettable(L, 2)) {
                 conf->bus_speed = luaL_checkinteger(L, -1);
             }
+            lua_pop(L, 1);
+
             lua_pushstring(L, "flush_rate");
             if (LUA_TNUMBER == lua_gettable(L, 2)) {
                 conf->flush_rate = luaL_checkinteger(L, -1);
             }
+            lua_pop(L, 1);
+
+            lua_pushstring(L, "hbp");
+            if (LUA_TNUMBER == lua_gettable(L, 2)) {
+                conf->hbp = luaL_checkinteger(L, -1);
+            }
+            lua_pop(L, 1);
+
+            lua_pushstring(L, "hspw");
+            if (LUA_TNUMBER == lua_gettable(L, 2)) {
+                conf->hspw = luaL_checkinteger(L, -1);
+            }
+            lua_pop(L, 1);
+
+            lua_pushstring(L, "hfp");
+            if (LUA_TNUMBER == lua_gettable(L, 2)) {
+                conf->hfp = luaL_checkinteger(L, -1);
+            }
+            lua_pop(L, 1);
+
             lua_pushstring(L, "vfp");
             if (LUA_TNUMBER == lua_gettable(L, 2)) {
                 conf->vfp = luaL_checkinteger(L, -1);
             }
-            lua_pushstring(L, "vbp");
+            lua_pop(L, 1);
+
+            lua_pushstring(L, "vspw");
             if (LUA_TNUMBER == lua_gettable(L, 2)) {
-                conf->vbp = luaL_checkinteger(L, -1);
+                conf->vspw = luaL_checkinteger(L, -1);
             }
-            lua_pushstring(L, "vs");
+            lua_pop(L, 1);
+
+            lua_pushstring(L, "vbp");
             if (LUA_TNUMBER == lua_gettable(L, 2)) {
-                conf->vs = luaL_checkinteger(L, -1);
+                conf->vbp = luaL_checkinteger(L, -1);
             }
             lua_pop(L, 1);