Fix G29 with 3 point

This commit is contained in:
MagoKimbra 2017-06-04 14:39:31 +02:00
parent 9f295581f0
commit 663ff7f92a

View file

@ -4198,19 +4198,19 @@ void home_all_axes() { gcode_G28(true); }
ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position; ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position;
ABL_VAR float xGridSpacing, yGridSpacing; ABL_VAR float xGridSpacing, yGridSpacing;
#if ABL_PLANAR #if ENABLED(AUTO_BED_LEVELING_LINEAR)
ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X, ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X,
abl_grid_points_y = GRID_MAX_POINTS_Y; abl_grid_points_y = GRID_MAX_POINTS_Y;
ABL_VAR bool do_topography_map; ABL_VAR bool do_topography_map;
#else // 3-point #else // Bilinear
uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X, uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X,
abl_grid_points_y = GRID_MAX_POINTS_Y; abl_grid_points_y = GRID_MAX_POINTS_Y;
#endif #endif
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(PROBE_MANUALLY) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(PROBE_MANUALLY)
#if ABL_PLANAR #if ENABLED(AUTO_BED_LEVELING_LINEAR)
ABL_VAR int abl2; ABL_VAR int abl2;
#else // 3-point #else // Bilinear
int constexpr abl2 = GRID_MAX_POINTS; int constexpr abl2 = GRID_MAX_POINTS;
#endif #endif
#endif #endif
@ -4230,6 +4230,8 @@ void home_all_axes() { gcode_G28(true); }
#elif ENABLED(AUTO_BED_LEVELING_3POINT) #elif ENABLED(AUTO_BED_LEVELING_3POINT)
int constexpr abl2 = 3;
// Probe at 3 arbitrary points // Probe at 3 arbitrary points
ABL_VAR vector_3 points[3] = { ABL_VAR vector_3 points[3] = {
vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, 0), vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, 0),
@ -4522,7 +4524,7 @@ void home_all_axes() { gcode_G28(true); }
#elif ENABLED(AUTO_BED_LEVELING_3POINT) #elif ENABLED(AUTO_BED_LEVELING_3POINT)
points[i].z = measured_z; points[abl_probe_index].z = measured_z;
#endif #endif
} }