From d554c1dda81bdccd4b49ea4dc0462268e3f28c46 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <sourcetree@thinkyhead.com>
Date: Tue, 30 Aug 2016 14:16:13 -0500
Subject: [PATCH] Clean up planner kernel pass methods
---
Marlin/planner.cpp | 12 +++++-------
Marlin/planner.h | 4 ++--
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp
index dd065988fc..3a1ffd1393 100644
--- a/Marlin/planner.cpp
+++ b/Marlin/planner.cpp
@@ -203,9 +203,8 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor,
// The kernel called by recalculate() when scanning the plan from last to first entry.
-void Planner::reverse_pass_kernel(block_t* previous, block_t* current, block_t* next) {
+void Planner::reverse_pass_kernel(block_t* current, block_t* next) {
if (!current) return;
- UNUSED(previous);
if (next) {
// 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() {
block[2] = block[1];
block[1] = block[0];
block[0] = &block_buffer[b];
- reverse_pass_kernel(block[0], block[1], block[2]);
+ reverse_pass_kernel(block[1], block[2]);
}
}
}
// The kernel called by recalculate() when scanning the plan from first to last entry.
-void Planner::forward_pass_kernel(block_t* previous, block_t* current, block_t* next) {
+void Planner::forward_pass_kernel(block_t* previous, block_t* current) {
if (!previous) return;
- UNUSED(next);
// If the previous block is an acceleration block, but it is not long enough to complete the
// full speed change within the block, we need to adjust the entry speed accordingly. Entry
@@ -288,9 +286,9 @@ void Planner::forward_pass() {
block[0] = block[1];
block[1] = block[2];
block[2] = &block_buffer[b];
- forward_pass_kernel(block[0], block[1], block[2]);
+ forward_pass_kernel(block[0], block[1]);
}
- forward_pass_kernel(block[1], block[2], NULL);
+ forward_pass_kernel(block[1], block[2]);
}
/**
diff --git a/Marlin/planner.h b/Marlin/planner.h
index 740553668a..e1159294a0 100644
--- a/Marlin/planner.h
+++ b/Marlin/planner.h
@@ -320,8 +320,8 @@ class Planner {
static void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor);
- static void reverse_pass_kernel(block_t* previous, block_t* current, block_t* next);
- static void forward_pass_kernel(block_t* previous, block_t* current, block_t* next);
+ static void reverse_pass_kernel(block_t* current, block_t* next);
+ static void forward_pass_kernel(block_t* previous, block_t* current);
static void reverse_pass();
static void forward_pass();
--
GitLab