Przeglądaj źródła

One fewer G29 error string

Scott Lahteine 6 lat temu
rodzic
commit
39f1222060
1 zmienionych plików z 3 dodań i 8 usunięć
  1. 3
    8
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+ 3
- 8
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Wyświetl plik

1737
      * use cases for the users. So we can wait and see what to do with it.
1737
      * use cases for the users. So we can wait and see what to do with it.
1738
      */
1738
      */
1739
     void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() {
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
       if (!a) {
1742
       if (!a) {
1743
         SERIAL_ECHOLNPGM("?EEPROM storage not available.");
1743
         SERIAL_ECHOLNPGM("?EEPROM storage not available.");
1744
         return;
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
         return;
1749
         return;
1750
       }
1750
       }
1751
 
1751
 
1752
       g29_storage_slot = parser.value_int();
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
       float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
1754
       float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
1760
       settings.load_mesh(g29_storage_slot, &tmp_z_values);
1755
       settings.load_mesh(g29_storage_slot, &tmp_z_values);
1761
 
1756
 

Ładowanie…
Anuluj
Zapisz