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
             }
2714
             }
2715
     }
2715
     }
2716
   #endif // ABL_BILINEAR_SUBDIVISION
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
 #endif // AUTO_BED_LEVELING_BILINEAR
2725
 #endif // AUTO_BED_LEVELING_BILINEAR
2718
 
2726
 
2719
 /**
2727
 /**
4730
       if (!dryrun) extrapolate_unprobed_bed_level();
4738
       if (!dryrun) extrapolate_unprobed_bed_level();
4731
       print_bilinear_leveling_grid();
4739
       print_bilinear_leveling_grid();
4732
 
4740
 
4741
+      refresh_bed_level();
4742
+
4733
       #if ENABLED(ABL_BILINEAR_SUBDIVISION)
4743
       #if ENABLED(ABL_BILINEAR_SUBDIVISION)
4734
-        bed_level_virt_interpolate();
4735
         bed_level_virt_print();
4744
         bed_level_virt_print();
4736
       #endif
4745
       #endif
4737
 
4746
 

+ 7
- 6
Marlin/configuration_store.cpp View File

179
   #include "ubl.h"
179
   #include "ubl.h"
180
 #endif
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
 #endif
184
 #endif
185
 
185
 
186
 /**
186
 /**
218
   #if HAS_BED_PROBE
218
   #if HAS_BED_PROBE
219
     refresh_zprobe_zoffset();
219
     refresh_zprobe_zoffset();
220
   #endif
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
 #if ENABLED(EEPROM_SETTINGS)
228
 #if ENABLED(EEPROM_SETTINGS)
753
           EEPROM_READ(bilinear_grid_spacing);        // 2 ints
758
           EEPROM_READ(bilinear_grid_spacing);        // 2 ints
754
           EEPROM_READ(bilinear_start);               // 2 ints
759
           EEPROM_READ(bilinear_start);               // 2 ints
755
           EEPROM_READ(bed_level_grid);               // 9 to 256 floats
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
         else // EEPROM data is stale
762
         else // EEPROM data is stale
762
       #endif // AUTO_BED_LEVELING_BILINEAR
763
       #endif // AUTO_BED_LEVELING_BILINEAR

Loading…
Cancel
Save