Browse Source

Cleanup to planner.cpp

Scott Lahteine 8 years ago
parent
commit
0e71e7b2fb
2 changed files with 4 additions and 6 deletions
  1. 3
    3
      Marlin/planner.cpp
  2. 1
    3
      Marlin/planner.h

+ 3
- 3
Marlin/planner.cpp View File

@@ -942,7 +942,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
942 942
    * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
943 943
    */
944 944
   #if IS_CORE
945
-    float delta_mm[7];
945
+    float delta_mm[Z_HEAD + 1];
946 946
     #if CORE_IS_XY
947 947
       delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS];
948 948
       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
963 963
       delta_mm[C_AXIS] = CORESIGN(db - dc) * steps_to_mm[C_AXIS];
964 964
     #endif
965 965
   #else
966
-    float delta_mm[4];
966
+    float delta_mm[XYZE];
967 967
     delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS];
968 968
     delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS];
969 969
     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
995 995
 
996 996
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
997 997
   #if ENABLED(SLOWDOWN) || ENABLED(ULTRA_LCD) || defined(XY_FREQUENCY_LIMIT)
998
+    // Segment time im micro seconds
998 999
     unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
999 1000
   #endif
1000 1001
   #if ENABLED(SLOWDOWN)
1001
-    // Segment time im micro seconds
1002 1002
     if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2) {
1003 1003
       if (segment_time < min_segment_time) {
1004 1004
         // buffer is draining, add extra time.  The amount of time added increases if the buffer is still emptied more.

+ 1
- 3
Marlin/planner.h View File

@@ -414,9 +414,7 @@ class Planner {
414 414
     #endif
415 415
 
416 416
     #if ENABLED(AUTOTEMP)
417
-      static float autotemp_max;
418
-      static float autotemp_min;
419
-      static float autotemp_factor;
417
+      static float autotemp_min, autotemp_max, autotemp_factor;
420 418
       static bool autotemp_enabled;
421 419
       static void getHighESpeed();
422 420
       static void autotemp_M104_M109();

Loading…
Cancel
Save