diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 24ad7a15f..0838a687c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -13505,7 +13505,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif if (stepper_inactive_time) { - if (planner.blocks_queued()) + if (planner.has_blocks_queued()) previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, previous_move_ms + stepper_inactive_time)) { #if ENABLED(DISABLE_INACTIVE_X) @@ -13583,7 +13583,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #if ENABLED(EXTRUDER_RUNOUT_PREVENT) if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP && ELAPSED(ms, previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && !planner.blocks_queued() + && !planner.has_blocks_queued() ) { #if ENABLED(SWITCHING_EXTRUDER) const bool oldstatus = E0_ENABLE_READ; @@ -13692,7 +13692,7 @@ void idle( #if ENABLED(I2C_POSITION_ENCODERS) static millis_t i2cpem_next_update_ms; - if (planner.blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) { + if (planner.has_blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) { I2CPEM.update(); i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS; } diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 0ef1e17fb..493abb50d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -457,7 +457,7 @@ void Planner::check_axes_activity() { #endif #endif - if (blocks_queued()) { + if (has_blocks_queued()) { #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) @@ -1536,7 +1536,7 @@ void Planner::buffer_segment(const float &a, const float &b, const float &c, con //*/ // Always split the first move into two (if not homing or probing) - if (!blocks_queued()) { + if (!has_blocks_queued()) { #define _BETWEEN(A) (position[A##_AXIS] + target[A##_AXIS]) >> 1 const int32_t between[ABCE] = { _BETWEEN(A), _BETWEEN(B), _BETWEEN(C), _BETWEEN(E) }; diff --git a/Marlin/planner.h b/Marlin/planner.h index 575f3d900..6a76cdcaf 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -508,14 +508,14 @@ class Planner { /** * Does the buffer have any blocks queued? */ - static inline bool blocks_queued() { return (block_buffer_head != block_buffer_tail); } + static inline bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); } /** * "Discard" the block and "release" the memory. * Called when the current block is no longer needed. */ FORCE_INLINE static void discard_current_block() { - if (blocks_queued()) + if (has_blocks_queued()) block_buffer_tail = BLOCK_MOD(block_buffer_tail + 1); } @@ -524,7 +524,7 @@ class Planner { * Called after an interrupted move to throw away the rest of the move. */ FORCE_INLINE static bool discard_continued_block() { - const bool discard = blocks_queued() && TEST(block_buffer[block_buffer_tail].flag, BLOCK_BIT_CONTINUED); + const bool discard = has_blocks_queued() && TEST(block_buffer[block_buffer_tail].flag, BLOCK_BIT_CONTINUED); if (discard) discard_current_block(); return discard; } @@ -535,7 +535,7 @@ class Planner { * WARNING: Called from Stepper ISR context! */ static block_t* get_current_block() { - if (blocks_queued()) { + if (has_blocks_queued()) { block_t * const block = &block_buffer[block_buffer_tail]; // If the block has no trapezoid calculated, it's unsafe to execute. diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index df5018d9f..e9dbbf40e 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1112,7 +1112,7 @@ void Stepper::init() { /** * Block until all buffered steps are executed / cleaned */ -void Stepper::synchronize() { while (planner.blocks_queued() || cleaning_buffer_counter) idle(); } +void Stepper::synchronize() { while (planner.has_blocks_queued() || cleaning_buffer_counter) idle(); } /** * Set the stepper positions directly in steps @@ -1212,7 +1212,7 @@ void Stepper::finish_and_disable() { void Stepper::quick_stop() { cleaning_buffer_counter = 5000; DISABLE_STEPPER_DRIVER_INTERRUPT(); - while (planner.blocks_queued()) planner.discard_current_block(); + while (planner.has_blocks_queued()) planner.discard_current_block(); current_block = NULL; ENABLE_STEPPER_DRIVER_INTERRUPT(); #if ENABLED(ULTRA_LCD)