alienwalker 3 лет назад
Родитель
Сommit
cacb0bcc66

+ 2 - 0
components/lcd/luat_lcd.c

@@ -99,8 +99,10 @@ const char* luat_lcd_name(luat_lcd_conf_t* conf) {
 }
 
 int luat_lcd_init(luat_lcd_conf_t* conf) {
+	conf->is_init_done = 0;
     int ret = conf->opts->init(conf);
     if (ret == 0) {
+    	conf->is_init_done = 1;
         for (size_t i = 0; i < LUAT_LCD_CONF_COUNT; i++)
         {
             if (confs[i] == NULL) {

+ 2 - 2
components/lcd/luat_lcd.h

@@ -49,7 +49,6 @@ typedef struct luat_lcd_conf {
     uint8_t pin_pwr;
     uint8_t pin_rst;
 
-    uint8_t direction;//方向
     uint32_t w;
     uint32_t h;
     uint32_t buffer_size;
@@ -57,6 +56,7 @@ typedef struct luat_lcd_conf {
     uint8_t xoffset;//偏移
     uint8_t yoffset;//偏移
     uint8_t auto_flush;
+    uint8_t direction;//方向
     u8g2_t luat_lcd_u8g2 ;
     struct luat_lcd_opts* opts;
     luat_spi_device_t* lcd_spi_device;
@@ -67,7 +67,7 @@ typedef struct luat_lcd_conf {
     int buff_ref;
     uint16_t flush_y_min;
     uint16_t flush_y_max;
-
+    uint8_t is_init_done;
 } luat_lcd_conf_t;
 
 typedef struct luat_lcd_opts {

+ 0 - 4
components/lvgl/binding/luat_lib_lvgl7.c

@@ -82,13 +82,9 @@ static luat_lcd_conf_t* lcd_conf;
 LUAT_WEAK void luat_lv_disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) {
     //-----
     if (lcd_conf != NULL) {
-#ifdef LV_NO_BLOCK_FLUSH
-        luat_lcd_draw_no_block(lcd_conf, area->x1, area->y1, area->x2, area->y2, color_p, disp_drv->buffer->flushing_last);
-#else
         luat_lcd_draw(lcd_conf, area->x1, area->y1, area->x2, area->y2, color_p);
         if (disp_drv->buffer->flushing_last)
             luat_lcd_flush(lcd_conf);
-#endif
     }
     //LLOGD("CALL disp_flush (%d, %d, %d, %d)", area->x1, area->y1, area->x2, area->y2);
     lv_disp_flush_ready(disp_drv);