Pārlūkot izejas kodu

No retroactive changes with M851 Z

Scott Lahteine 6 gadus atpakaļ
vecāks
revīzija
622d100c30
4 mainītis faili ar 5 papildinājumiem un 58 dzēšanām
  1. 0
    1
      Marlin/Marlin.h
  2. 3
    45
      Marlin/Marlin_main.cpp
  3. 0
    4
      Marlin/configuration_store.cpp
  4. 2
    8
      Marlin/ultralcd.cpp

+ 0
- 1
Marlin/Marlin.h Parādīt failu

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

+ 3
- 45
Marlin/Marlin_main.cpp Parādīt failu

@@ -9320,22 +9320,17 @@ inline void gcode_M226() {
9320 9320
       for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
9321 9321
         if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
9322 9322
           const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
9323
+          thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
9323 9324
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9324
-            if (a == Z_AXIS) {
9325
-              zprobe_zoffset += offs;
9326
-              refresh_zprobe_zoffset(true); // 'true' to not babystep
9327
-            }
9325
+            zprobe_zoffset += offs;
9328 9326
           #endif
9329
-          thermalManager.babystep_axis((AxisEnum)a, offs * planner.axis_steps_per_mm[a]);
9330 9327
         }
9331 9328
     #else
9332 9329
       if (parser.seenval('Z') || parser.seenval('S')) {
9333 9330
         const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
9331
+        thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
9334 9332
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9335 9333
           zprobe_zoffset += offs;
9336
-          refresh_zprobe_zoffset(); // This will babystep the axis
9337
-        #else
9338
-          thermalManager.babystep_axis(Z_AXIS, offs * planner.axis_steps_per_mm[Z_AXIS]);
9339 9334
         #endif
9340 9335
       }
9341 9336
     #endif
@@ -10039,42 +10034,6 @@ inline void gcode_M502() {
10039 10034
 
10040 10035
 #if HAS_BED_PROBE
10041 10036
 
10042
-  void refresh_zprobe_zoffset(const bool no_babystep/*=false*/) {
10043
-    static float last_zoffset = NAN;
10044
-
10045
-    if (!isnan(last_zoffset)) {
10046
-
10047
-      #if ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(BABYSTEP_ZPROBE_OFFSET) || ENABLED(DELTA)
10048
-        const float diff = zprobe_zoffset - last_zoffset;
10049
-      #endif
10050
-
10051
-      #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
10052
-        // Correct bilinear grid for new probe offset
10053
-        if (diff) {
10054
-          for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
10055
-            for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
10056
-              z_values[x][y] -= diff;
10057
-        }
10058
-        #if ENABLED(ABL_BILINEAR_SUBDIVISION)
10059
-          bed_level_virt_interpolate();
10060
-        #endif
10061
-      #endif
10062
-
10063
-      #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
10064
-        if (!no_babystep && planner.leveling_active)
10065
-          thermalManager.babystep_axis(Z_AXIS, -LROUND(diff * planner.axis_steps_per_mm[Z_AXIS]));
10066
-      #else
10067
-        UNUSED(no_babystep);
10068
-      #endif
10069
-
10070
-      #if ENABLED(DELTA) // correct the delta_height
10071
-        delta_height -= diff;
10072
-      #endif
10073
-    }
10074
-
10075
-    last_zoffset = zprobe_zoffset;
10076
-  }
10077
-
10078 10037
   inline void gcode_M851() {
10079 10038
     SERIAL_ECHO_START();
10080 10039
     SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
@@ -10082,7 +10041,6 @@ inline void gcode_M502() {
10082 10041
       const float value = parser.value_linear_units();
10083 10042
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
10084 10043
         zprobe_zoffset = value;
10085
-        refresh_zprobe_zoffset();
10086 10044
         SERIAL_ECHO(zprobe_zoffset);
10087 10045
       }
10088 10046
       else

+ 0
- 4
Marlin/configuration_store.cpp Parādīt failu

@@ -246,10 +246,6 @@ void MarlinSettings::postprocess() {
246 246
     set_z_fade_height(new_z_fade_height);
247 247
   #endif
248 248
 
249
-  #if HAS_BED_PROBE
250
-    refresh_zprobe_zoffset();
251
-  #endif
252
-
253 249
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
254 250
     refresh_bed_level();
255 251
     //set_bed_leveling_enabled(leveling_is_on);

+ 2
- 8
Marlin/ultralcd.cpp Parādīt failu

@@ -1112,7 +1112,6 @@ void kill_screen(const char* lcd_msg) {
1112 1112
               thermalManager.babystep_axis(Z_AXIS, babystep_increment);
1113 1113
 
1114 1114
             zprobe_zoffset = new_zoffset;
1115
-            refresh_zprobe_zoffset(true);
1116 1115
             lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
1117 1116
           }
1118 1117
         }
@@ -1678,11 +1677,6 @@ void kill_screen(const char* lcd_msg) {
1678 1677
     static void lcd_load_settings()    { lcd_completion_feedback(settings.load()); }
1679 1678
   #endif
1680 1679
 
1681
-  #if HAS_BED_PROBE && DISABLED(BABYSTEP_ZPROBE_OFFSET)
1682
-    static void lcd_refresh_zprobe_zoffset() { refresh_zprobe_zoffset(); }
1683
-  #endif
1684
-
1685
-
1686 1680
   #if ENABLED(LEVEL_BED_CORNERS)
1687 1681
 
1688 1682
     /**
@@ -2002,7 +1996,7 @@ void kill_screen(const char* lcd_msg) {
2002 1996
       #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
2003 1997
         MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
2004 1998
       #elif HAS_BED_PROBE
2005
-        MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
1999
+        MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
2006 2000
       #endif
2007 2001
 
2008 2002
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
@@ -3659,7 +3653,7 @@ void kill_screen(const char* lcd_msg) {
3659 3653
     #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
3660 3654
       MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
3661 3655
     #elif HAS_BED_PROBE
3662
-      MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
3656
+      MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
3663 3657
     #endif
3664 3658
 
3665 3659
     // M203 / M205 - Feedrate items

Notiek ielāde…
Atcelt
Saglabāt