Browse Source

🐛 Fix MKS UI compile (#22388, #22395)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
vanilla_fb_2.0.x
Malderin 3 years ago
committed by Scott Lahteine
parent
commit
f1161a9a5f
  1. 2
      Marlin/src/MarlinCore.cpp
  2. 7
      Marlin/src/lcd/extui/mks_ui/draw_error_message.cpp
  3. 7
      Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp
  4. 4
      Marlin/src/lcd/extui/mks_ui/draw_ui.cpp
  5. 9
      Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp
  6. 12
      Marlin/src/lcd/extui/mks_ui/mks_hardware.h
  7. 7
      Marlin/src/lcd/extui/mks_ui/pic_manager.cpp
  8. 6
      Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp

2
Marlin/src/MarlinCore.cpp

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

7
Marlin/src/lcd/extui/mks_ui/draw_error_message.cpp

@ -25,15 +25,10 @@
#include "draw_ui.h"
#include <lv_conf.h>
#include "tft_lvgl_configuration.h"
#include "SPI_TFT.h"
#include "../../../inc/MarlinConfig.h"
#if ENABLED(MKS_TEST)
#include "mks_hardware_test.h"
#endif
#include "mks_hardware.h"
static lv_obj_t *scr;

7
Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp

@ -39,10 +39,7 @@
#include "draw_touch_calibration.h"
#endif
#if ENABLED(MKS_TEST)
#include "mks_hardware_test.h"
#endif
#include "mks_hardware.h"
#include <stdio.h>
#define ICON_POS_Y 38
@ -129,7 +126,7 @@ void lv_draw_ready_print() {
ZERO(disp_state_stack._disp_state);
scr = lv_screen_create(PRINT_READY_UI, "");
if (mks_test_flag == 0x1E) {
if (TERN0(SDSUPPORT, mks_test_flag == 0x1E)) {
// Create image buttons
buttonTool = lv_imgbtn_create(scr, "F:/bmp_tool.bin", event_handler, ID_TOOL);

4
Marlin/src/lcd/extui/mks_ui/draw_ui.cpp

@ -52,7 +52,7 @@
#endif
#if ENABLED(MKS_TEST)
#include "mks_hardware_test.h"
#include "mks_hardware.h"
#endif
CFG_ITMES gCfgItems;
@ -1366,7 +1366,7 @@ void print_time_count() {
void LV_TASK_HANDLER() {
lv_task_handler();
#if ENABLED(MKS_TEST)
#if BOTH(MKS_TEST, SDSUPPORT)
if (mks_test_flag == 0x1E) mks_hardware_test();
#endif

9
Marlin/src/lcd/extui/mks_ui/mks_hardware_test.cpp → Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp

@ -37,7 +37,7 @@
#if ENABLED(MKS_TEST)
#include "mks_hardware_test.h"
#include "mks_hardware.h"
bool pw_det_sta, pw_off_sta, mt_det_sta;
#if PIN_EXISTS(MT_DET_2)
@ -127,6 +127,8 @@
delay(100);
}
#if ENABLED(SDSUPPORT)
void mks_gpio_test() {
init_test_gpio();
@ -199,6 +201,8 @@
mks_disp_test();
}
#endif
#endif // MKS_TEST
static const uint16_t ASCII_Table_16x24[] PROGMEM = {
@ -613,10 +617,9 @@ void disp_assets_update_progress(const char *msg) {
disp_string(100, 165, buf, 0xFFFF, 0x0000);
}
#if BOTH(MKS_TEST, SDSUPPORT)
uint8_t mks_test_flag = 0;
const char *MKSTestPath = "MKS_TEST";
#if ENABLED(SDSUPPORT)
void mks_test_get() {
SdFile dir, root = card.getroot();
if (dir.open(&root, MKSTestPath, O_RDONLY))

12
Marlin/src/lcd/extui/mks_ui/mks_hardware_test.h → Marlin/src/lcd/extui/mks_ui/mks_hardware.h

@ -21,15 +21,19 @@
*/
#pragma once
#include "../../../inc/MarlinConfigPre.h"
#include <lvgl.h>
void mks_gpio_test();
// Functions for MKS_TEST
#if BOTH(MKS_TEST, SDSUPPORT)
void mks_hardware_test();
void mks_test_get();
void mks_gpio_test();
extern uint8_t mks_test_flag;
#endif
void disp_char_1624(uint16_t x, uint16_t y, uint8_t c, uint16_t charColor, uint16_t bkColor);
// String display and assets
void disp_string(uint16_t x, uint16_t y, const char * string, uint16_t charColor, uint16_t bkColor);
void disp_assets_update();
void disp_assets_update_progress(const char *msg);
extern uint8_t mks_test_flag;

7
Marlin/src/lcd/extui/mks_ui/pic_manager.cpp

@ -27,14 +27,9 @@
#include "draw_ui.h"
#include "pic_manager.h"
#include "draw_ready_print.h"
#if ENABLED(MKS_TEST)
#include "mks_hardware_test.h"
#endif
#include "mks_hardware.h"
#include "SPIFlashStorage.h"
#include "../../../libs/W25Qxx.h"
#include "../../../sd/cardreader.h"
#include "../../../MarlinCore.h"

6
Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp

@ -29,7 +29,7 @@
#include "draw_ready_print.h"
#include "pic_manager.h"
#include "mks_hardware_test.h"
#include "mks_hardware.h"
#include "draw_ui.h"
#include "SPIFlashStorage.h"
#include <lvgl.h>
@ -139,7 +139,7 @@ void tft_lvgl_init() {
#if ENABLED(SDSUPPORT)
UpdateAssets();
watchdog_refresh(); // LVGL init takes time
mks_test_get();
TERN_(MKS_TEST, mks_test_get());
#endif
touch.Init();
@ -231,7 +231,7 @@ void tft_lvgl_init() {
if (ready) lv_draw_ready_print();
#if ENABLED(MKS_TEST)
#if BOTH(MKS_TEST, SDSUPPORT)
if (mks_test_flag == 0x1E) mks_gpio_test();
#endif
}

Loading…
Cancel
Save