Browse Source

Cleanup to planner.cpp

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

Loading…
Cancel
Save