From 9a1c4f91fe920afb05fef4c82ddb23476c05e3de Mon Sep 17 00:00:00 2001 From: Sola <42537573+solawc@users.noreply.github.com> Date: Tue, 23 Mar 2021 13:58:52 +0800 Subject: [PATCH] Fix MKS H43 sensorless homing (#21388) --- Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp | 4 ++-- Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp index bfa518446d..78865bbfd6 100644 --- a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp @@ -36,7 +36,7 @@ #include "../../../../marlinui.h" #if ENABLED(HAS_STEALTHCHOP) - #include "../../../../module/stepper/trinamic.h" + #include "../../../../../module/stepper/trinamic.h" #endif #if ENABLED(DGUS_UI_MOVE_DIS_OPTION) @@ -746,9 +746,9 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // SDCard File listing + VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), #if ENABLED(SDSUPPORT) VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr), - VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr), VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr), VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename), diff --git a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp index 577171a135..bf2b05dcbf 100644 --- a/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp @@ -1246,6 +1246,9 @@ void DGUSScreenHandler::MKS_FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) { uint16_t val_t = swap16(*(uint16_t*)val_ptr); + if (!print_job_timer.isPaused() && !queue.ring_buffer.empty()) + return; + switch (val_t) { case 0: #if HOTENDS >= 1 @@ -1497,7 +1500,7 @@ bool DGUSScreenHandler::loop() { static bool booted = false; if (!booted && ELAPSED(ms, TERN(USE_MKS_GREEN_UI, 1000, BOOTSCREEN_TIMEOUT))) { booted = true; - #if ANY_AXIS_HAS(STEALTHCHOP) + #if USE_SENSORLESS #if AXIS_HAS_STEALTHCHOP(X) tmc_x_step = stepperX.homing_threshold(); #endif