No retroactive changes with M851 Z

master
Scott Lahteine 7 years ago
parent 74997a5251
commit 622d100c30

@ -345,7 +345,6 @@ void report_current_position();
#if HAS_BED_PROBE #if HAS_BED_PROBE
extern float zprobe_zoffset; extern float zprobe_zoffset;
void refresh_zprobe_zoffset(const bool no_babystep=false);
#define DEPLOY_PROBE() set_probe_deployed(true) #define DEPLOY_PROBE() set_probe_deployed(true)
#define STOW_PROBE() set_probe_deployed(false) #define STOW_PROBE() set_probe_deployed(false)
#else #else

@ -9320,22 +9320,17 @@ inline void gcode_M226() {
for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) { if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2); const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (a == Z_AXIS) { zprobe_zoffset += offs;
zprobe_zoffset += offs;
refresh_zprobe_zoffset(true); // 'true' to not babystep
}
#endif #endif
thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
} }
#else #else
if (parser.seenval('Z') || parser.seenval('S')) { if (parser.seenval('Z') || parser.seenval('S')) {
const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2); const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
zprobe_zoffset += offs; zprobe_zoffset += offs;
refresh_zprobe_zoffset(); // This will babystep the axis
#else
thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
#endif #endif
} }
#endif #endif
@ -10039,42 +10034,6 @@ inline void gcode_M502() {
#if HAS_BED_PROBE #if HAS_BED_PROBE
void refresh_zprobe_zoffset(const bool no_babystep/*=false*/) {
static float last_zoffset = NAN;
if (!isnan(last_zoffset)) {
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(BABYSTEP_ZPROBE_OFFSET) || ENABLED(DELTA)
const float diff = zprobe_zoffset - last_zoffset;
#endif
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Correct bilinear grid for new probe offset
if (diff) {
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
z_values[x][y] -= diff;
}
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
bed_level_virt_interpolate();
#endif
#endif
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (!no_babystep && planner.leveling_active)
thermalManager.babystep_axis(Z_AXIS, -LROUND(diff * planner.axis_steps_per_mm[Z_AXIS]));
#else
UNUSED(no_babystep);
#endif
#if ENABLED(DELTA) // correct the delta_height
delta_height -= diff;
#endif
}
last_zoffset = zprobe_zoffset;
}
inline void gcode_M851() { inline void gcode_M851() {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " "); SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
@ -10082,7 +10041,6 @@ inline void gcode_M502() {
const float value = parser.value_linear_units(); const float value = parser.value_linear_units();
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
zprobe_zoffset = value; zprobe_zoffset = value;
refresh_zprobe_zoffset();
SERIAL_ECHO(zprobe_zoffset); SERIAL_ECHO(zprobe_zoffset);
} }
else else

@ -246,10 +246,6 @@ void MarlinSettings::postprocess() {
set_z_fade_height(new_z_fade_height); set_z_fade_height(new_z_fade_height);
#endif #endif
#if HAS_BED_PROBE
refresh_zprobe_zoffset();
#endif
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
refresh_bed_level(); refresh_bed_level();
//set_bed_leveling_enabled(leveling_is_on); //set_bed_leveling_enabled(leveling_is_on);

@ -1112,7 +1112,6 @@ void kill_screen(const char* lcd_msg) {
thermalManager.babystep_axis(Z_AXIS, babystep_increment); thermalManager.babystep_axis(Z_AXIS, babystep_increment);
zprobe_zoffset = new_zoffset; zprobe_zoffset = new_zoffset;
refresh_zprobe_zoffset(true);
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
} }
} }
@ -1678,11 +1677,6 @@ void kill_screen(const char* lcd_msg) {
static void lcd_load_settings() { lcd_completion_feedback(settings.load()); } static void lcd_load_settings() { lcd_completion_feedback(settings.load()); }
#endif #endif
#if HAS_BED_PROBE && DISABLED(BABYSTEP_ZPROBE_OFFSET)
static void lcd_refresh_zprobe_zoffset() { refresh_zprobe_zoffset(); }
#endif
#if ENABLED(LEVEL_BED_CORNERS) #if ENABLED(LEVEL_BED_CORNERS)
/** /**
@ -2002,7 +1996,7 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
#elif HAS_BED_PROBE #elif HAS_BED_PROBE
MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset); MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
#endif #endif
MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
@ -3659,7 +3653,7 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
#elif HAS_BED_PROBE #elif HAS_BED_PROBE
MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset); MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
#endif #endif
// M203 / M205 - Feedrate items // M203 / M205 - Feedrate items

Loading…
Cancel
Save