瀏覽代碼

Reduce M420 code for UBL slightly

Scott Lahteine 8 年之前
父節點
當前提交
df7b4252fd
共有 1 個檔案被更改,包括 11 行新增9 行删除
  1. 11
    9
      Marlin/Marlin_main.cpp

+ 11
- 9
Marlin/Marlin_main.cpp 查看文件

7486
    *   Z[height] Sets the Z fade height (0 or none to disable)
7486
    *   Z[height] Sets the Z fade height (0 or none to disable)
7487
    *   V[bool]   Verbose - Print the leveling grid
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
   inline void gcode_M420() {
7493
   inline void gcode_M420() {
7494
 
7494
 
7505
         ubl.load_mesh(storage_slot);
7505
         ubl.load_mesh(storage_slot);
7506
         if (storage_slot != ubl.state.eeprom_storage_slot) ubl.store_state();
7506
         if (storage_slot != ubl.state.eeprom_storage_slot) ubl.store_state();
7507
         ubl.state.eeprom_storage_slot = storage_slot;
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
     #endif // AUTO_BED_LEVELING_UBL
7509
     #endif // AUTO_BED_LEVELING_UBL
7513
 
7510
 
7522
             bed_level_virt_print();
7519
             bed_level_virt_print();
7523
           #endif
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
       #elif ENABLED(MESH_BED_LEVELING)
7522
       #elif ENABLED(MESH_BED_LEVELING)
7530
         if (mbl.has_mesh()) {
7523
         if (mbl.has_mesh()) {
7531
           SERIAL_ECHOLNPGM("Mesh Bed Level data:");
7524
           SERIAL_ECHOLNPGM("Mesh Bed Level data:");
7534
       #endif
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
     bool to_enable = false;
7539
     bool to_enable = false;
7538
     if (code_seen('S')) {
7540
     if (code_seen('S')) {
7539
       to_enable = code_value_bool();
7541
       to_enable = code_value_bool();

Loading…
取消
儲存