Browse Source

Clean up planner kernel pass methods

Scott Lahteine 8 years ago
parent
commit
d554c1dda8
2 changed files with 7 additions and 9 deletions
  1. 5
    7
      Marlin/planner.cpp
  2. 2
    2
      Marlin/planner.h

+ 5
- 7
Marlin/planner.cpp View File

203
 
203
 
204
 
204
 
205
 // The kernel called by recalculate() when scanning the plan from last to first entry.
205
 // The kernel called by recalculate() when scanning the plan from last to first entry.
206
-void Planner::reverse_pass_kernel(block_t* previous, block_t* current, block_t* next) {
206
+void Planner::reverse_pass_kernel(block_t* current, block_t* next) {
207
   if (!current) return;
207
   if (!current) return;
208
-  UNUSED(previous);
209
 
208
 
210
   if (next) {
209
   if (next) {
211
     // If entry speed is already at the maximum entry speed, no need to recheck. Block is cruising.
210
     // If entry speed is already at the maximum entry speed, no need to recheck. Block is cruising.
250
       block[2] = block[1];
249
       block[2] = block[1];
251
       block[1] = block[0];
250
       block[1] = block[0];
252
       block[0] = &block_buffer[b];
251
       block[0] = &block_buffer[b];
253
-      reverse_pass_kernel(block[0], block[1], block[2]);
252
+      reverse_pass_kernel(block[1], block[2]);
254
     }
253
     }
255
   }
254
   }
256
 }
255
 }
257
 
256
 
258
 // The kernel called by recalculate() when scanning the plan from first to last entry.
257
 // The kernel called by recalculate() when scanning the plan from first to last entry.
259
-void Planner::forward_pass_kernel(block_t* previous, block_t* current, block_t* next) {
258
+void Planner::forward_pass_kernel(block_t* previous, block_t* current) {
260
   if (!previous) return;
259
   if (!previous) return;
261
-  UNUSED(next);
262
 
260
 
263
   // If the previous block is an acceleration block, but it is not long enough to complete the
261
   // If the previous block is an acceleration block, but it is not long enough to complete the
264
   // full speed change within the block, we need to adjust the entry speed accordingly. Entry
262
   // full speed change within the block, we need to adjust the entry speed accordingly. Entry
288
     block[0] = block[1];
286
     block[0] = block[1];
289
     block[1] = block[2];
287
     block[1] = block[2];
290
     block[2] = &block_buffer[b];
288
     block[2] = &block_buffer[b];
291
-    forward_pass_kernel(block[0], block[1], block[2]);
289
+    forward_pass_kernel(block[0], block[1]);
292
   }
290
   }
293
-  forward_pass_kernel(block[1], block[2], NULL);
291
+  forward_pass_kernel(block[1], block[2]);
294
 }
292
 }
295
 
293
 
296
 /**
294
 /**

+ 2
- 2
Marlin/planner.h View File

320
 
320
 
321
     static void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor);
321
     static void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor);
322
 
322
 
323
-    static void reverse_pass_kernel(block_t* previous, block_t* current, block_t* next);
324
-    static void forward_pass_kernel(block_t* previous, block_t* current, block_t* next);
323
+    static void reverse_pass_kernel(block_t* current, block_t* next);
324
+    static void forward_pass_kernel(block_t* previous, block_t* current);
325
 
325
 
326
     static void reverse_pass();
326
     static void reverse_pass();
327
     static void forward_pass();
327
     static void forward_pass();

Loading…
Cancel
Save