From 0e71e7b2fb5450a462f8225cf447e10b4b4c1c67 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 11 Nov 2016 18:11:04 -0600 Subject: [PATCH] Cleanup to planner.cpp --- Marlin/planner.cpp | 6 +++--- Marlin/planner.h | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 62ddf0999..5c71faf08 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -942,7 +942,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. */ #if IS_CORE - float delta_mm[7]; + float delta_mm[Z_HEAD + 1]; #if CORE_IS_XY delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS]; delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS]; @@ -963,7 +963,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS]; #endif #else - float delta_mm[4]; + float delta_mm[XYZE]; delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS]; delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS]; delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS]; @@ -995,10 +995,10 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT) + // Segment time im micro seconds unsigned long segment_time = lround(1000000.0 / inverse_mm_s); #endif #if ENABLED(SLOWDOWN) - // Segment time im micro seconds if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2) { if (segment_time < min_segment_time) { // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. diff --git a/Marlin/planner.h b/Marlin/planner.h index 38513baed..4bd350c74 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -414,9 +414,7 @@ class Planner { #endif #if ENABLED(AUTOTEMP) - static float autotemp_max; - static float autotemp_min; - static float autotemp_factor; + static float autotemp_min, autotemp_max, autotemp_factor; static bool autotemp_enabled; static void getHighESpeed(); static void autotemp_M104_M109();