Skip to content

Commit

Permalink
Fix cleaning_buffer_counter check (#21115)
Browse files Browse the repository at this point in the history
  • Loading branch information
espr14 authored Feb 18, 2021
1 parent 241297b commit a4c7386
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1690,13 +1690,15 @@ bool Planner::_buffer_steps(const xyze_long_t &target
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
) {

// If we are cleaning, do not accept queuing of movements
if (cleaning_buffer_counter) return false;

// Wait for the next available block
uint8_t next_buffer_head;
block_t * const block = get_next_free_block(next_buffer_head);

// If we are cleaning, do not accept queuing of movements
// This must be after get_next_free_block() because it calls idle()
// where cleaning_buffer_counter can be changed
if (cleaning_buffer_counter) return false;

// Fill the block with the specified movement
if (!_populate_block(block, false, target
#if HAS_POSITION_FLOAT
Expand Down

0 comments on commit a4c7386

Please sign in to comment.