Browse Source

Use named indices for delta_grid_spacing

Scott Lahteine 9 years ago
parent
commit
748228cf40
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      Marlin/Marlin_main.cpp

+ 5
- 5
Marlin/Marlin_main.cpp View File

@@ -3613,8 +3613,8 @@ inline void gcode_G28() {
3613 3613
                 yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1);
3614 3614
 
3615 3615
       #if ENABLED(DELTA)
3616
-        delta_grid_spacing[0] = xGridSpacing;
3617
-        delta_grid_spacing[1] = yGridSpacing;
3616
+        delta_grid_spacing[X_AXIS] = xGridSpacing;
3617
+        delta_grid_spacing[Y_AXIS] = yGridSpacing;
3618 3618
         float zoffset = zprobe_zoffset;
3619 3619
         if (code_seen('Z')) zoffset += code_value_axis_units(Z_AXIS);
3620 3620
       #else // !DELTA
@@ -7897,12 +7897,12 @@ void clamp_to_software_endstops(float target[3]) {
7897 7897
 
7898 7898
     // Adjust print surface height by linear interpolation over the bed_level array.
7899 7899
     void adjust_delta(float cartesian[3]) {
7900
-      if (delta_grid_spacing[0] == 0 || delta_grid_spacing[1] == 0) return; // G29 not done!
7900
+      if (delta_grid_spacing[X_AXIS] == 0 || delta_grid_spacing[Y_AXIS] == 0) return; // G29 not done!
7901 7901
 
7902 7902
       int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2;
7903 7903
       float h1 = 0.001 - half, h2 = half - 0.001,
7904
-            grid_x = max(h1, min(h2, RAW_X_POSITION(cartesian[X_AXIS]) / delta_grid_spacing[0])),
7905
-            grid_y = max(h1, min(h2, RAW_Y_POSITION(cartesian[Y_AXIS]) / delta_grid_spacing[1]));
7904
+            grid_x = max(h1, min(h2, RAW_X_POSITION(cartesian[X_AXIS]) / delta_grid_spacing[X_AXIS])),
7905
+            grid_y = max(h1, min(h2, RAW_Y_POSITION(cartesian[Y_AXIS]) / delta_grid_spacing[Y_AXIS]));
7906 7906
       int floor_x = floor(grid_x), floor_y = floor(grid_y);
7907 7907
       float ratio_x = grid_x - floor_x, ratio_y = grid_y - floor_y,
7908 7908
             z1 = bed_level[floor_x + half][floor_y + half],

Loading…
Cancel
Save