Scott Lahteine 5 лет назад
Родитель
Сommit
39f1222060
1 измененных файлов: 3 добавлений и 8 удалений
  1. 3
    8
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+ 3
- 8
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Просмотреть файл

@@ -1737,25 +1737,20 @@
1737 1737
      * use cases for the users. So we can wait and see what to do with it.
1738 1738
      */
1739 1739
     void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() {
1740
-      int16_t a = settings.calc_num_meshes();
1740
+      const int16_t a = settings.calc_num_meshes();
1741 1741
 
1742 1742
       if (!a) {
1743 1743
         SERIAL_ECHOLNPGM("?EEPROM storage not available.");
1744 1744
         return;
1745 1745
       }
1746 1746
 
1747
-      if (!parser.has_value()) {
1748
-        SERIAL_ECHOLNPAIR("?Storage slot # required.\n?Use 0 to ", a - 1);
1747
+      if (!parser.has_value() || !WITHIN(g29_storage_slot, 0, a - 1)) {
1748
+        SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
1749 1749
         return;
1750 1750
       }
1751 1751
 
1752 1752
       g29_storage_slot = parser.value_int();
1753 1753
 
1754
-      if (!WITHIN(g29_storage_slot, 0, a - 1)) {
1755
-        SERIAL_ECHOLNPAIR("?Invalid storage slot.\n?Use 0 to ", a - 1);
1756
-        return;
1757
-      }
1758
-
1759 1754
       float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
1760 1755
       settings.load_mesh(g29_storage_slot, &tmp_z_values);
1761 1756
 

Загрузка…
Отмена
Сохранить