From 2fd1c48e1a6617ab0c747de800c53db97933ecf0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Aug 2024 14:26:44 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Prefer=20has=5Fblocks=5Fqueued?= =?UTF-8?q?=20over=20movesplanned?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 3 ++- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- Marlin/src/module/ft_motion.cpp | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index ec746c1d459b..f1594b2ce640 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -325,7 +325,7 @@ bool pin_is_protected(const pin_t pin) { #pragma GCC diagnostic pop bool printer_busy() { - return planner.movesplanned() || printingIsActive(); + return planner.has_blocks_queued() || printingIsActive(); } /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b61fb0e44282..f04d79f1552b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3880,7 +3880,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #elif ENABLED(LASER_MOVE_G0_OFF) #error "LASER_MOVE_G0_OFF is no longer required, G0 and G28 cannot apply power." #elif ENABLED(LASER_MOVE_G28_OFF) - #error "LASER_MOVE_G0_OFF is no longer required, G0 and G28 cannot apply power." + #error "LASER_MOVE_G28_OFF is no longer required, G0 and G28 cannot apply power." #elif ENABLED(LASER_MOVE_POWER) #error "LASER_MOVE_POWER is no longer applicable." #endif diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index 815d0783bf4e..ef9452a9db85 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -1670,7 +1670,8 @@ namespace Anycubic { if (getAxisPosition_mm(Z) < 0) setAxisPosition_mm(0, Z, 8); } - // if (!planner.movesplanned())return; + //if (!planner.has_blocks_queued()) return; + switch (key_value) { case 0: break; diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index ae7702e8a421..3b30332488a6 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1070,7 +1070,7 @@ namespace ExtUI { void injectCommands_P(PGM_P const gcode) { queue.inject_P(gcode); } void injectCommands(char * const gcode) { queue.inject(gcode); } - bool commandsInQueue() { return (planner.movesplanned() || queue.has_commands_queued()); } + bool commandsInQueue() { return (planner.has_blocks_queued() || queue.has_commands_queued()); } bool isAxisPositionKnown(const axis_t axis) { return axis_is_trusted((AxisEnum)axis); } bool isAxisPositionKnown(const extruder_t) { return axis_is_trusted(E_AXIS); } diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index ff7225a16679..3b9f0f3983a7 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -507,7 +507,7 @@ void _ubl_map_screen_homing() { * UBL Homing before LCD map */ void _ubl_goto_map_screen() { - if (planner.movesplanned()) return; // The ACTION_ITEM will do nothing + if (planner.has_blocks_queued()) return; // The ACTION_ITEM will do nothing if (!all_axes_trusted()) { set_all_unhomed(); queue.inject_P(G28_STR); diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index a94516478b96..fc8b6a14e37c 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -166,7 +166,7 @@ void FTMotion::loop() { discard_planner_block_protected(); // Check if the block needs to be runout: - if (!batchRdy && !planner.movesplanned()) { + if (!batchRdy && !planner.has_blocks_queued()) { runoutBlock(); makeVector(); // Do an additional makeVector call to guarantee batchRdy set this loop. }