Browse Source

Add a method to refresh bilinear bed level after a change

Scott Lahteine 8 years ago
parent
commit
23cdbbb2d3
2 changed files with 17 additions and 7 deletions
  1. 10
    1
      Marlin/Marlin_main.cpp
  2. 7
    6
      Marlin/configuration_store.cpp

+ 10
- 1
Marlin/Marlin_main.cpp View File

@@ -2714,6 +2714,14 @@ static void clean_up_after_endstop_or_probe_move() {
2714 2714
             }
2715 2715
     }
2716 2716
   #endif // ABL_BILINEAR_SUBDIVISION
2717
+
2718
+  // Refresh after other values have been updated
2719
+  void refresh_bed_level() {
2720
+    #if ENABLED(ABL_BILINEAR_SUBDIVISION)
2721
+      bed_level_virt_interpolate();
2722
+    #endif
2723
+  }
2724
+
2717 2725
 #endif // AUTO_BED_LEVELING_BILINEAR
2718 2726
 
2719 2727
 /**
@@ -4730,8 +4738,9 @@ inline void gcode_G28() {
4730 4738
       if (!dryrun) extrapolate_unprobed_bed_level();
4731 4739
       print_bilinear_leveling_grid();
4732 4740
 
4741
+      refresh_bed_level();
4742
+
4733 4743
       #if ENABLED(ABL_BILINEAR_SUBDIVISION)
4734
-        bed_level_virt_interpolate();
4735 4744
         bed_level_virt_print();
4736 4745
       #endif
4737 4746
 

+ 7
- 6
Marlin/configuration_store.cpp View File

@@ -179,8 +179,8 @@ MarlinSettings settings;
179 179
   #include "ubl.h"
180 180
 #endif
181 181
 
182
-#if ENABLED(ABL_BILINEAR_SUBDIVISION)
183
-  extern void bed_level_virt_interpolate();
182
+#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
183
+  extern void refresh_bed_level();
184 184
 #endif
185 185
 
186 186
 /**
@@ -218,6 +218,11 @@ void MarlinSettings::postprocess() {
218 218
   #if HAS_BED_PROBE
219 219
     refresh_zprobe_zoffset();
220 220
   #endif
221
+
222
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
223
+    refresh_bed_level();
224
+    //set_bed_leveling_enabled(leveling_is_on);
225
+  #endif
221 226
 }
222 227
 
223 228
 #if ENABLED(EEPROM_SETTINGS)
@@ -753,10 +758,6 @@ void MarlinSettings::postprocess() {
753 758
           EEPROM_READ(bilinear_grid_spacing);        // 2 ints
754 759
           EEPROM_READ(bilinear_start);               // 2 ints
755 760
           EEPROM_READ(bed_level_grid);               // 9 to 256 floats
756
-          #if ENABLED(ABL_BILINEAR_SUBDIVISION)
757
-            bed_level_virt_interpolate();
758
-          #endif
759
-          //set_bed_leveling_enabled(leveling_is_on);
760 761
         }
761 762
         else // EEPROM data is stale
762 763
       #endif // AUTO_BED_LEVELING_BILINEAR

Loading…
Cancel
Save