Browse Source

Fix cleaning_buffer_counter check (#21115)

espr14 4 years ago
parent
commit
a4c73860a1
No account linked to committer's email address
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      Marlin/src/module/planner.cpp

+ 5
- 3
Marlin/src/module/planner.cpp View File

1690
   , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
1690
   , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
1691
 ) {
1691
 ) {
1692
 
1692
 
1693
-  // If we are cleaning, do not accept queuing of movements
1694
-  if (cleaning_buffer_counter) return false;
1695
-
1696
   // Wait for the next available block
1693
   // Wait for the next available block
1697
   uint8_t next_buffer_head;
1694
   uint8_t next_buffer_head;
1698
   block_t * const block = get_next_free_block(next_buffer_head);
1695
   block_t * const block = get_next_free_block(next_buffer_head);
1699
 
1696
 
1697
+  // If we are cleaning, do not accept queuing of movements
1698
+  // This must be after get_next_free_block() because it calls idle()
1699
+  // where cleaning_buffer_counter can be changed
1700
+  if (cleaning_buffer_counter) return false;
1701
+
1700
   // Fill the block with the specified movement
1702
   // Fill the block with the specified movement
1701
   if (!_populate_block(block, false, target
1703
   if (!_populate_block(block, false, target
1702
     #if HAS_POSITION_FLOAT
1704
     #if HAS_POSITION_FLOAT

Loading…
Cancel
Save