Browse Source

Fix MKS UI compile (#22388)

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

+ 1
- 1
Marlin/src/MarlinCore.cpp View File

70
 #if HAS_TFT_LVGL_UI
70
 #if HAS_TFT_LVGL_UI
71
   #include "lcd/extui/mks_ui/tft_lvgl_configuration.h"
71
   #include "lcd/extui/mks_ui/tft_lvgl_configuration.h"
72
   #include "lcd/extui/mks_ui/draw_ui.h"
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
   #include <lvgl.h>
74
   #include <lvgl.h>
75
 #endif
75
 #endif
76
 
76
 

+ 1
- 6
Marlin/src/lcd/extui/mks_ui/draw_error_message.cpp View File

25
 
25
 
26
 #include "draw_ui.h"
26
 #include "draw_ui.h"
27
 #include <lv_conf.h>
27
 #include <lv_conf.h>
28
-
29
 #include "tft_lvgl_configuration.h"
28
 #include "tft_lvgl_configuration.h"
30
-
31
 #include "SPI_TFT.h"
29
 #include "SPI_TFT.h"
32
 #include "../../../inc/MarlinConfig.h"
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
 static lv_obj_t *scr;
33
 static lv_obj_t *scr;
39
 
34
 

+ 2
- 5
Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp View File

39
   #include "draw_touch_calibration.h"
39
   #include "draw_touch_calibration.h"
40
 #endif
40
 #endif
41
 
41
 
42
-#if ENABLED(MKS_TEST)
43
-  #include "mks_hardware_test.h"
44
-#endif
45
-
42
+#include "mks_hardware.h"
46
 #include <stdio.h>
43
 #include <stdio.h>
47
 
44
 
48
 #define ICON_POS_Y          38
45
 #define ICON_POS_Y          38
129
   ZERO(disp_state_stack._disp_state);
126
   ZERO(disp_state_stack._disp_state);
130
   scr = lv_screen_create(PRINT_READY_UI, "");
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
     // Create image buttons
130
     // Create image buttons
134
     buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", event_handler, ID_TOOL);
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 View File

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

Marlin/src/lcd/extui/mks_ui/mks_hardware_test.cpp → Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp View File

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

21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
+#include "../../../inc/MarlinConfigPre.h"
25
+
24
 #include <lvgl.h>
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
 void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor);
36
 void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor);
32
 void disp_assets_update();
37
 void disp_assets_update();
33
 void disp_assets_update_progress(const char *msg);
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 View File

27
 #include "draw_ui.h"
27
 #include "draw_ui.h"
28
 #include "pic_manager.h"
28
 #include "pic_manager.h"
29
 #include "draw_ready_print.h"
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
 #include "SPIFlashStorage.h"
31
 #include "SPIFlashStorage.h"
36
 #include "../../../libs/W25Qxx.h"
32
 #include "../../../libs/W25Qxx.h"
37
-
38
 #include "../../../sd/cardreader.h"
33
 #include "../../../sd/cardreader.h"
39
 #include "../../../MarlinCore.h"
34
 #include "../../../MarlinCore.h"
40
 
35
 

+ 2
- 2
Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp View File

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

Loading…
Cancel
Save