Bladeren bron

Fix MKS UI compile (#22388)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Malderin 3 jaren geleden
bovenliggende
commit
67019bc277
No account linked to committer's email address

+ 1
- 1
Marlin/src/MarlinCore.cpp Bestand weergeven

@@ -70,7 +70,7 @@
70 70
 #if HAS_TFT_LVGL_UI
71 71
   #include "lcd/extui/mks_ui/tft_lvgl_configuration.h"
72 72
   #include "lcd/extui/mks_ui/draw_ui.h"
73
-  #include "lcd/extui/mks_ui/mks_hardware_test.h"
73
+  #include "lcd/extui/mks_ui/mks_hardware.h"
74 74
   #include <lvgl.h>
75 75
 #endif
76 76
 

+ 1
- 6
Marlin/src/lcd/extui/mks_ui/draw_error_message.cpp Bestand weergeven

@@ -25,15 +25,10 @@
25 25
 
26 26
 #include "draw_ui.h"
27 27
 #include <lv_conf.h>
28
-
29 28
 #include "tft_lvgl_configuration.h"
30
-
31 29
 #include "SPI_TFT.h"
32 30
 #include "../../../inc/MarlinConfig.h"
33
-
34
-#if ENABLED(MKS_TEST)
35
-  #include "mks_hardware_test.h"
36
-#endif
31
+#include "mks_hardware.h"
37 32
 
38 33
 static lv_obj_t *scr;
39 34
 

+ 2
- 5
Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp Bestand weergeven

@@ -39,10 +39,7 @@
39 39
   #include "draw_touch_calibration.h"
40 40
 #endif
41 41
 
42
-#if ENABLED(MKS_TEST)
43
-  #include "mks_hardware_test.h"
44
-#endif
45
-
42
+#include "mks_hardware.h"
46 43
 #include <stdio.h>
47 44
 
48 45
 #define ICON_POS_Y          38
@@ -129,7 +126,7 @@ void lv_draw_ready_print() {
129 126
   ZERO(disp_state_stack._disp_state);
130 127
   scr = lv_screen_create(PRINT_READY_UI, "");
131 128
 
132
-  if (mks_test_flag == 0x1E) {
129
+  if (TERN0(SDSUPPORT, mks_test_flag == 0x1E)) {
133 130
     // Create image buttons
134 131
     buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", event_handler, ID_TOOL);
135 132
 

+ 2
- 2
Marlin/src/lcd/extui/mks_ui/draw_ui.cpp Bestand weergeven

@@ -52,7 +52,7 @@
52 52
 #endif
53 53
 
54 54
 #if ENABLED(MKS_TEST)
55
-  #include "mks_hardware_test.h"
55
+  #include "mks_hardware.h"
56 56
 #endif
57 57
 
58 58
 CFG_ITMES gCfgItems;
@@ -1366,7 +1366,7 @@ void print_time_count() {
1366 1366
 void LV_TASK_HANDLER() {
1367 1367
   lv_task_handler();
1368 1368
 
1369
-  #if ENABLED(MKS_TEST)
1369
+  #if BOTH(MKS_TEST, SDSUPPORT)
1370 1370
     if (mks_test_flag == 0x1E) mks_hardware_test();
1371 1371
   #endif
1372 1372
 

Marlin/src/lcd/extui/mks_ui/mks_hardware_test.cpp → Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp Bestand weergeven

@@ -37,7 +37,7 @@
37 37
 
38 38
 #if ENABLED(MKS_TEST)
39 39
 
40
-  #include "mks_hardware_test.h"
40
+  #include "mks_hardware.h"
41 41
 
42 42
   bool pw_det_sta, pw_off_sta, mt_det_sta;
43 43
   #if PIN_EXISTS(MT_DET_2)
@@ -613,10 +613,9 @@ void disp_assets_update_progress(const char *msg) {
613 613
   disp_string(100, 165, buf, 0xFFFF, 0x0000);
614 614
 }
615 615
 
616
-uint8_t mks_test_flag = 0;
617
-const char *MKSTestPath = "MKS_TEST";
618
-
619 616
 #if ENABLED(SDSUPPORT)
617
+  uint8_t mks_test_flag = 0;
618
+  const char *MKSTestPath = "MKS_TEST";
620 619
   void mks_test_get() {
621 620
     SdFile dir, root = card.getroot();
622 621
     if (dir.open(&root, MKSTestPath, O_RDONLY))

Marlin/src/lcd/extui/mks_ui/mks_hardware_test.h → Marlin/src/lcd/extui/mks_ui/mks_hardware.h Bestand weergeven

@@ -21,15 +21,22 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include "../../../inc/MarlinConfigPre.h"
25
+
24 26
 #include <lvgl.h>
25 27
 
26
-void mks_gpio_test();
27
-void mks_hardware_test();
28
-void mks_test_get();
28
+// Functions for MKS_TEST
29
+#if ENABLED(MKS_TEST)
30
+  void mks_gpio_test();
31
+  void mks_hardware_test();
32
+  void mks_test_get();
33
+#endif
29 34
 
30
-void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor);
35
+// String display and assets
31 36
 void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor);
32 37
 void disp_assets_update();
33 38
 void disp_assets_update_progress(const char *msg);
34 39
 
35
-extern uint8_t mks_test_flag;
40
+#if ENABLED(SDSUPPORT)
41
+  extern uint8_t mks_test_flag;
42
+#endif

+ 1
- 6
Marlin/src/lcd/extui/mks_ui/pic_manager.cpp Bestand weergeven

@@ -27,14 +27,9 @@
27 27
 #include "draw_ui.h"
28 28
 #include "pic_manager.h"
29 29
 #include "draw_ready_print.h"
30
-
31
-#if ENABLED(MKS_TEST)
32
-  #include "mks_hardware_test.h"
33
-#endif
34
-
30
+#include "mks_hardware.h"
35 31
 #include "SPIFlashStorage.h"
36 32
 #include "../../../libs/W25Qxx.h"
37
-
38 33
 #include "../../../sd/cardreader.h"
39 34
 #include "../../../MarlinCore.h"
40 35
 

+ 2
- 2
Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp Bestand weergeven

@@ -29,7 +29,7 @@
29 29
 #include "draw_ready_print.h"
30 30
 
31 31
 #include "pic_manager.h"
32
-#include "mks_hardware_test.h"
32
+#include "mks_hardware.h"
33 33
 #include "draw_ui.h"
34 34
 #include "SPIFlashStorage.h"
35 35
 #include <lvgl.h>
@@ -231,7 +231,7 @@ void tft_lvgl_init() {
231 231
 
232 232
   if (ready) lv_draw_ready_print();
233 233
 
234
-  #if ENABLED(MKS_TEST)
234
+  #if BOTH(MKS_TEST, SDSUPPORT)
235 235
     if (mks_test_flag == 0x1E) mks_gpio_test();
236 236
   #endif
237 237
 }

Laden…
Annuleren
Opslaan