Browse Source

Reduce M420 code for UBL slightly

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

+ 11
- 9
Marlin/Marlin_main.cpp View File

@@ -7486,9 +7486,9 @@ void quickstop_stepper() {
7486 7486
    *   Z[height] Sets the Z fade height (0 or none to disable)
7487 7487
    *   V[bool]   Verbose - Print the leveling grid
7488 7488
    *
7489
-   *   With AUTO_BED_LEVELING_UBL only:
7489
+   * With AUTO_BED_LEVELING_UBL only:
7490 7490
    *
7491
-   *     L[index]  Load UBL mesh from index (0 is default)
7491
+   *   L[index]  Load UBL mesh from index (0 is default)
7492 7492
    */
7493 7493
   inline void gcode_M420() {
7494 7494
 
@@ -7505,9 +7505,6 @@ void quickstop_stepper() {
7505 7505
         ubl.load_mesh(storage_slot);
7506 7506
         if (storage_slot != ubl.state.eeprom_storage_slot) ubl.store_state();
7507 7507
         ubl.state.eeprom_storage_slot = storage_slot;
7508
-        ubl.display_map(0);  // Right now, we only support one type of map
7509
-        SERIAL_ECHOLNPAIR("UBL_MESH_VALID =  ", UBL_MESH_VALID);
7510
-        SERIAL_ECHOLNPAIR("eeprom_storage_slot = ", ubl.state.eeprom_storage_slot);
7511 7508
       }
7512 7509
     #endif // AUTO_BED_LEVELING_UBL
7513 7510
 
@@ -7522,10 +7519,6 @@ void quickstop_stepper() {
7522 7519
             bed_level_virt_print();
7523 7520
           #endif
7524 7521
         }
7525
-      #elif ENABLED(AUTO_BED_LEVELING_UBL)
7526
-        ubl.display_map(0);  // Currently only supports one map type
7527
-        SERIAL_ECHOLNPAIR("UBL_MESH_VALID =  ", UBL_MESH_VALID);
7528
-        SERIAL_ECHOLNPAIR("eeprom_storage_slot = ", ubl.state.eeprom_storage_slot);
7529 7522
       #elif ENABLED(MESH_BED_LEVELING)
7530 7523
         if (mbl.has_mesh()) {
7531 7524
           SERIAL_ECHOLNPGM("Mesh Bed Level data:");
@@ -7534,6 +7527,15 @@ void quickstop_stepper() {
7534 7527
       #endif
7535 7528
     }
7536 7529
 
7530
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
7531
+      // L to load a mesh from the EEPROM
7532
+      if (code_seen('L') || code_seen('V')) {
7533
+        ubl.display_map(0);  // Currently only supports one map type
7534
+        SERIAL_ECHOLNPAIR("UBL_MESH_VALID = ", UBL_MESH_VALID);
7535
+        SERIAL_ECHOLNPAIR("eeprom_storage_slot = ", ubl.state.eeprom_storage_slot);
7536
+      }
7537
+    #endif
7538
+
7537 7539
     bool to_enable = false;
7538 7540
     if (code_seen('S')) {
7539 7541
       to_enable = code_value_bool();

Loading…
Cancel
Save