Skip to content

Commit

Permalink
👷 Prefer has_blocks_queued over movesplanned
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 19, 2024
1 parent 301727d commit 2fd1c48
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_ubl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/ft_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down

0 comments on commit 2fd1c48

Please sign in to comment.