Browse Source

buffer_line can calculate while it's waiting

Scott Lahteine 8 years ago
parent
commit
c7f22f688f
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      Marlin/planner.cpp

+ 7
- 6
Marlin/planner.cpp View File

594
  *  extruder    - target extruder
594
  *  extruder    - target extruder
595
  */
595
  */
596
 void Planner::_buffer_line(const float &a, const float &b, const float &c, const float &e, float fr_mm_s, const uint8_t extruder) {
596
 void Planner::_buffer_line(const float &a, const float &b, const float &c, const float &e, float fr_mm_s, const uint8_t extruder) {
597
-  // Calculate the buffer head after we push this byte
598
-  int next_buffer_head = next_block_index(block_buffer_head);
599
-
600
-  // If the buffer is full: good! That means we are well ahead of the robot.
601
-  // Rest here until there is room in the buffer.
602
-  while (block_buffer_tail == next_buffer_head) idle();
603
 
597
 
604
   // The target position of the tool in absolute steps
598
   // The target position of the tool in absolute steps
605
   // Calculate target position in absolute steps
599
   // Calculate target position in absolute steps
662
     }
656
     }
663
   #endif
657
   #endif
664
 
658
 
659
+  // Calculate the buffer head after we push this byte
660
+  int next_buffer_head = next_block_index(block_buffer_head);
661
+
662
+  // If the buffer is full: good! That means we are well ahead of the robot.
663
+  // Rest here until there is room in the buffer.
664
+  while (block_buffer_tail == next_buffer_head) idle();
665
+
665
   // Prepare to set up new block
666
   // Prepare to set up new block
666
   block_t* block = &block_buffer[block_buffer_head];
667
   block_t* block = &block_buffer[block_buffer_head];
667
 
668
 

Loading…
Cancel
Save