Kaynağa Gözat

Keep watchdog refreshed in LVGL init (#19900)

Victor Oliveira 3 yıl önce
ebeveyn
işleme
c60696dbae
No account linked to committer's email address

+ 1
- 0
Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp Dosyayı Görüntüle

@@ -488,6 +488,7 @@ uint8_t public_buf[512];
488 488
   }
489 489
 
490 490
   void UpdateAssets() {
491
+    if (!card.isMounted()) return;
491 492
     SdFile dir, root = card.getroot();
492 493
     if (dir.open(&root, assetsPath, O_RDONLY)) {
493 494
 

+ 10
- 7
Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp Dosyayı Görüntüle

@@ -116,17 +116,20 @@ void tft_lvgl_init() {
116 116
   ui_cfg_init();
117 117
   disp_language_init();
118 118
 
119
-  //init tft first!
119
+  watchdog_refresh();     // LVGL init takes time
120
+
121
+  // Init TFT first!
120 122
   SPI_TFT.spi_init(SPI_FULL_SPEED);
121 123
   SPI_TFT.LCD_init();
122 124
 
125
+  watchdog_refresh();     // LVGL init takes time
126
+
123 127
   //spi_flash_read_test();
124 128
   #if ENABLED(SDSUPPORT)
125
-    watchdog_refresh();
126 129
     UpdateAssets();
130
+    watchdog_refresh();   // LVGL init takes time
127 131
   #endif
128 132
 
129
-  watchdog_refresh();
130 133
   mks_test_get();
131 134
 
132 135
   touch.Init();
@@ -189,9 +192,11 @@ void tft_lvgl_init() {
189 192
 
190 193
   lv_encoder_pin_init();
191 194
 
195
+  bool ready = true;
192 196
   #if ENABLED(POWER_LOSS_RECOVERY)
193 197
     recovery.load();
194 198
     if (recovery.valid()) {
199
+      ready = false;
195 200
       if (gCfgItems.from_flash_pic)
196 201
         flash_preview_begin = true;
197 202
       else
@@ -201,14 +206,12 @@ void tft_lvgl_init() {
201 206
 
202 207
       strncpy(public_buf_m, recovery.info.sd_filename, sizeof(public_buf_m));
203 208
       card.printLongPath(public_buf_m);
204
-
205 209
       strncpy(list_file.long_name[sel_id], card.longFilename, sizeof(list_file.long_name[sel_id]));
206
-
207 210
       lv_draw_printing();
208 211
     }
209
-    else
210 212
   #endif
211
-    lv_draw_ready_print();
213
+
214
+  if (ready) lv_draw_ready_print();
212 215
 
213 216
   if (mks_test_flag == 0x1E)
214 217
     mks_gpio_test();

Loading…
İptal
Kaydet