Browse Source

current_position not static

Scott Lahteine 10 years ago
parent
commit
3162971cd6
2 changed files with 7 additions and 9 deletions
  1. 1
    1
      Marlin/Marlin_main.cpp
  2. 6
    8
      Marlin/planner.cpp

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -205,7 +205,7 @@
205 205
 bool Running = true;
206 206
 
207 207
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
208
-static float current_position[NUM_AXIS] = { 0.0 };
208
+float current_position[NUM_AXIS] = { 0.0 };
209 209
 static float destination[NUM_AXIS] = { 0.0 };
210 210
 bool axis_known_position[3] = { false };
211 211
 

+ 6
- 8
Marlin/planner.cpp View File

@@ -87,7 +87,7 @@ unsigned long axis_steps_per_sqr_second[NUM_AXIS];
87 87
     0.0, 1.0, 0.0,
88 88
     0.0, 0.0, 1.0
89 89
   };
90
-#endif // #ifdef ENABLE_AUTO_BED_LEVELING
90
+#endif // ENABLE_AUTO_BED_LEVELING
91 91
 
92 92
 // The current position of the tool in absolute steps
93 93
 long position[NUM_AXIS];   //rescaled from extern when axis_steps_per_unit are changed by gcode
@@ -472,7 +472,7 @@ float junction_deviation = 0.1;
472 472
   void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder)
473 473
 #else
474 474
   void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
475
-#endif  //ENABLE_AUTO_BED_LEVELING
475
+#endif  // ENABLE_AUTO_BED_LEVELING
476 476
 {
477 477
   // Calculate the buffer head after we push this byte
478 478
   int next_buffer_head = next_block_index(block_buffer_head);
@@ -487,9 +487,7 @@ float junction_deviation = 0.1;
487 487
 
488 488
   #ifdef MESH_BED_LEVELING
489 489
     if (mbl.active) z += mbl.get_z(x, y);
490
-  #endif
491
-
492
-  #ifdef ENABLE_AUTO_BED_LEVELING
490
+  #elif defined(ENABLE_AUTO_BED_LEVELING)
493 491
     apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
494 492
   #endif
495 493
 
@@ -979,10 +977,10 @@ float junction_deviation = 0.1;
979 977
   void plan_set_position(const float &x, const float &y, const float &z, const float &e)
980 978
 #endif // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING
981 979
   {
982
-    #ifdef ENABLE_AUTO_BED_LEVELING
983
-      apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
984
-    #elif defined(MESH_BED_LEVELING)
980
+    #ifdef MESH_BED_LEVELING
985 981
       if (mbl.active) z += mbl.get_z(x, y);
982
+    #elif defined(ENABLE_AUTO_BED_LEVELING)
983
+      apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
986 984
     #endif
987 985
 
988 986
     float nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]);

Loading…
Cancel
Save