Преглед на файлове

Moves do_blocking_move_to_xy() out of the HAS_BED_PROBE define

João Brázio преди 8 години
родител
ревизия
fdea8b6e6a
променени са 1 файла, в които са добавени 57 реда и са изтрити 59 реда
  1. 57
    59
      Marlin/Marlin_main.cpp

+ 57
- 59
Marlin/Marlin_main.cpp Целия файл

@@ -1606,34 +1606,6 @@ inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[
1606 1606
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1607 1607
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1608 1608
 
1609
-//
1610
-// Prepare to do endstop or probe moves
1611
-// with custom feedrates.
1612
-//
1613
-//  - Save current feedrates
1614
-//  - Reset the rate multiplier
1615
-//  - Reset the command timeout
1616
-//  - Enable the endstops (for endstop moves)
1617
-//
1618
-static void setup_for_endstop_or_probe_move() {
1619
-  #if ENABLED(DEBUG_LEVELING_FEATURE)
1620
-    if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position);
1621
-  #endif
1622
-  saved_feedrate = feedrate;
1623
-  saved_feedrate_multiplier = feedrate_multiplier;
1624
-  feedrate_multiplier = 100;
1625
-  refresh_cmd_timeout();
1626
-}
1627
-
1628
-static void clean_up_after_endstop_or_probe_move() {
1629
-  #if ENABLED(DEBUG_LEVELING_FEATURE)
1630
-    if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position);
1631
-  #endif
1632
-  feedrate = saved_feedrate;
1633
-  feedrate_multiplier = saved_feedrate_multiplier;
1634
-  refresh_cmd_timeout();
1635
-}
1636
-
1637 1609
 #if ENABLED(DELTA)
1638 1610
   /**
1639 1611
    * Calculate delta, start a line, and set current_position to destination
@@ -1713,6 +1685,38 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
1713 1685
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
1714 1686
 }
1715 1687
 
1688
+inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) {
1689
+  do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate);
1690
+}
1691
+
1692
+//
1693
+// Prepare to do endstop or probe moves
1694
+// with custom feedrates.
1695
+//
1696
+//  - Save current feedrates
1697
+//  - Reset the rate multiplier
1698
+//  - Reset the command timeout
1699
+//  - Enable the endstops (for endstop moves)
1700
+//
1701
+static void setup_for_endstop_or_probe_move() {
1702
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
1703
+    if (DEBUGGING(LEVELING)) DEBUG_POS("setup_for_endstop_or_probe_move", current_position);
1704
+  #endif
1705
+  saved_feedrate = feedrate;
1706
+  saved_feedrate_multiplier = feedrate_multiplier;
1707
+  feedrate_multiplier = 100;
1708
+  refresh_cmd_timeout();
1709
+}
1710
+
1711
+static void clean_up_after_endstop_or_probe_move() {
1712
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
1713
+    if (DEBUGGING(LEVELING)) DEBUG_POS("clean_up_after_endstop_or_probe_move", current_position);
1714
+  #endif
1715
+  feedrate = saved_feedrate;
1716
+  feedrate_multiplier = saved_feedrate_multiplier;
1717
+  refresh_cmd_timeout();
1718
+}
1719
+
1716 1720
 #if HAS_BED_PROBE
1717 1721
   /**
1718 1722
    * Raise Z to a minimum height to make room for a probe to move
@@ -1735,33 +1739,31 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
1735 1739
 
1736 1740
 #endif //HAS_BED_PROBE
1737 1741
 
1738
-#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE || HOTENDS > 1
1739
-  static bool axis_unhomed_error(const bool x, const bool y, const bool z) {
1740
-    const bool xx = x && !axis_homed[X_AXIS],
1741
-               yy = y && !axis_homed[Y_AXIS],
1742
-               zz = z && !axis_homed[Z_AXIS];
1743
-    if (xx || yy || zz) {
1744
-      SERIAL_ECHO_START;
1745
-      SERIAL_ECHOPGM(MSG_HOME " ");
1746
-      if (xx) SERIAL_ECHOPGM(MSG_X);
1747
-      if (yy) SERIAL_ECHOPGM(MSG_Y);
1748
-      if (zz) SERIAL_ECHOPGM(MSG_Z);
1749
-      SERIAL_ECHOLNPGM(" " MSG_FIRST);
1750
-
1751
-      #if ENABLED(ULTRA_LCD)
1752
-        char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1
1753
-        strcat_P(message, PSTR(MSG_HOME " "));
1754
-        if (xx) strcat_P(message, PSTR(MSG_X));
1755
-        if (yy) strcat_P(message, PSTR(MSG_Y));
1756
-        if (zz) strcat_P(message, PSTR(MSG_Z));
1757
-        strcat_P(message, PSTR(" " MSG_FIRST));
1758
-        lcd_setstatus(message);
1759
-      #endif
1760
-      return true;
1761
-    }
1762
-    return false;
1742
+static bool axis_unhomed_error(const bool x, const bool y, const bool z) {
1743
+  const bool xx = x && !axis_homed[X_AXIS],
1744
+             yy = y && !axis_homed[Y_AXIS],
1745
+             zz = z && !axis_homed[Z_AXIS];
1746
+  if (xx || yy || zz) {
1747
+    SERIAL_ECHO_START;
1748
+    SERIAL_ECHOPGM(MSG_HOME " ");
1749
+    if (xx) SERIAL_ECHOPGM(MSG_X);
1750
+    if (yy) SERIAL_ECHOPGM(MSG_Y);
1751
+    if (zz) SERIAL_ECHOPGM(MSG_Z);
1752
+    SERIAL_ECHOLNPGM(" " MSG_FIRST);
1753
+
1754
+    #if ENABLED(ULTRA_LCD)
1755
+      char message[3 * (LCD_WIDTH) + 1] = ""; // worst case is kana.utf with up to 3*LCD_WIDTH+1
1756
+      strcat_P(message, PSTR(MSG_HOME " "));
1757
+      if (xx) strcat_P(message, PSTR(MSG_X));
1758
+      if (yy) strcat_P(message, PSTR(MSG_Y));
1759
+      if (zz) strcat_P(message, PSTR(MSG_Z));
1760
+      strcat_P(message, PSTR(" " MSG_FIRST));
1761
+      lcd_setstatus(message);
1762
+    #endif
1763
+    return true;
1763 1764
   }
1764
-#endif
1765
+  return false;
1766
+}
1765 1767
 
1766 1768
 #if ENABLED(Z_PROBE_SLED)
1767 1769
 
@@ -2110,10 +2112,6 @@ inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
2110 2112
     return current_position[Z_AXIS];
2111 2113
   }
2112 2114
 
2113
-  inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) {
2114
-    do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate);
2115
-  }
2116
-
2117 2115
   //
2118 2116
   // - Move to the given XY
2119 2117
   // - Deploy the probe, if not already deployed
@@ -6626,7 +6624,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6626 6624
             delayed_move_time = 0;
6627 6625
             break;
6628 6626
         }
6629
- 
6627
+
6630 6628
         #if ENABLED(DEBUG_LEVELING_FEATURE)
6631 6629
           if (DEBUGGING(LEVELING)) {
6632 6630
             SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no");

Loading…
Отказ
Запис