Przeglądaj źródła

Clean up planner kernel pass methods

Scott Lahteine 8 lat temu
rodzic
commit
d554c1dda8
2 zmienionych plików z 7 dodań i 9 usunięć
  1. 5
    7
      Marlin/planner.cpp
  2. 2
    2
      Marlin/planner.h

+ 5
- 7
Marlin/planner.cpp Wyświetl plik

@@ -203,9 +203,8 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor,
203 203
 
204 204
 
205 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 207
   if (!current) return;
208
-  UNUSED(previous);
209 208
 
210 209
   if (next) {
211 210
     // If entry speed is already at the maximum entry speed, no need to recheck. Block is cruising.
@@ -250,15 +249,14 @@ void Planner::reverse_pass() {
250 249
       block[2] = block[1];
251 250
       block[1] = block[0];
252 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 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 259
   if (!previous) return;
261
-  UNUSED(next);
262 260
 
263 261
   // If the previous block is an acceleration block, but it is not long enough to complete the
264 262
   // full speed change within the block, we need to adjust the entry speed accordingly. Entry
@@ -288,9 +286,9 @@ void Planner::forward_pass() {
288 286
     block[0] = block[1];
289 287
     block[1] = block[2];
290 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 Wyświetl plik

@@ -320,8 +320,8 @@ class Planner {
320 320
 
321 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 326
     static void reverse_pass();
327 327
     static void forward_pass();

Ładowanie…
Anuluj
Zapisz