Browse Source

M420 can now enable/disable ABL

Scott Lahteine 8 years ago
parent
commit
56cf674150
1 changed files with 9 additions and 7 deletions
  1. 9
    7
      Marlin/Marlin_main.cpp

+ 9
- 7
Marlin/Marlin_main.cpp View File

@@ -225,7 +225,7 @@
225 225
  * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
226 226
  * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
227 227
  * M410 - Quickstop. Abort all planned moves.
228
- * M420 - Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING)
228
+ * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
229 229
  * M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING)
230 230
  * M428 - Set the home_offset based on the current_position. Nearest edge applies.
231 231
  * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
@@ -6312,12 +6312,14 @@ void quickstop_stepper() {
6312 6312
   SYNC_PLAN_POSITION_KINEMATIC();
6313 6313
 }
6314 6314
 
6315
-#if ENABLED(MESH_BED_LEVELING)
6316
-
6315
+#if PLANNER_LEVELING
6317 6316
   /**
6318
-   * M420: Enable/Disable Mesh Bed Leveling
6317
+   * M420: Enable/Disable Bed Leveling
6319 6318
    */
6320
-  inline void gcode_M420() { if (code_seen('S')) mbl.set_has_mesh(code_value_bool()); }
6319
+  inline void gcode_M420() { if (code_seen('S')) set_bed_leveling_enabled(code_value_bool()); }
6320
+#endif
6321
+
6322
+#if ENABLED(MESH_BED_LEVELING)
6321 6323
 
6322 6324
   /**
6323 6325
    * M421: Set a single Mesh Bed Leveling Z coordinate
@@ -7343,11 +7345,11 @@ void process_next_command() {
7343 7345
         gcode_G28();
7344 7346
         break;
7345 7347
 
7346
-      #if HAS_ABL || ENABLED(MESH_BED_LEVELING)
7348
+      #if PLANNER_LEVELING
7347 7349
         case 29: // G29 Detailed Z probe, probes the bed at 3 or more points.
7348 7350
           gcode_G29();
7349 7351
           break;
7350
-      #endif // HAS_ABL
7352
+      #endif // PLANNER_LEVELING
7351 7353
 
7352 7354
       #if HAS_BED_PROBE
7353 7355
 

Loading…
Cancel
Save