Browse Source

Always define axis_unhomed_err

Scott Lahteine 5 years ago
parent
commit
11d6a939df
2 changed files with 25 additions and 42 deletions
  1. 24
    28
      Marlin/src/module/motion.cpp
  2. 1
    14
      Marlin/src/module/motion.h

+ 24
- 28
Marlin/src/module/motion.cpp View File

@@ -47,7 +47,7 @@
47 47
   #include "../feature/bedlevel/bedlevel.h"
48 48
 #endif
49 49
 
50
-#if HAS_AXIS_UNHOMED_ERR && (ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI))
50
+#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
51 51
   #include "../lcd/ultralcd.h"
52 52
 #endif
53 53
 
@@ -1036,35 +1036,31 @@ void prepare_move_to_destination() {
1036 1036
   set_current_from_destination();
1037 1037
 }
1038 1038
 
1039
-#if HAS_AXIS_UNHOMED_ERR
1040
-
1041
-  bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
1042
-    #if ENABLED(HOME_AFTER_DEACTIVATE)
1043
-      const bool xx = x && !TEST(axis_known_position, X_AXIS),
1044
-                 yy = y && !TEST(axis_known_position, Y_AXIS),
1045
-                 zz = z && !TEST(axis_known_position, Z_AXIS);
1046
-    #else
1047
-      const bool xx = x && !TEST(axis_homed, X_AXIS),
1048
-                 yy = y && !TEST(axis_homed, Y_AXIS),
1049
-                 zz = z && !TEST(axis_homed, Z_AXIS);
1039
+bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
1040
+  #if ENABLED(HOME_AFTER_DEACTIVATE)
1041
+    const bool xx = x && !TEST(axis_known_position, X_AXIS),
1042
+               yy = y && !TEST(axis_known_position, Y_AXIS),
1043
+               zz = z && !TEST(axis_known_position, Z_AXIS);
1044
+  #else
1045
+    const bool xx = x && !TEST(axis_homed, X_AXIS),
1046
+               yy = y && !TEST(axis_homed, Y_AXIS),
1047
+               zz = z && !TEST(axis_homed, Z_AXIS);
1048
+  #endif
1049
+  if (xx || yy || zz) {
1050
+    SERIAL_ECHO_START();
1051
+    SERIAL_ECHOPGM(MSG_HOME " ");
1052
+    if (xx) SERIAL_CHAR('X');
1053
+    if (yy) SERIAL_CHAR('Y');
1054
+    if (zz) SERIAL_CHAR('Z');
1055
+    SERIAL_ECHOLNPGM(" " MSG_FIRST);
1056
+
1057
+    #if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
1058
+      ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
1050 1059
     #endif
1051
-    if (xx || yy || zz) {
1052
-      SERIAL_ECHO_START();
1053
-      SERIAL_ECHOPGM(MSG_HOME " ");
1054
-      if (xx) SERIAL_ECHOPGM(MSG_X);
1055
-      if (yy) SERIAL_ECHOPGM(MSG_Y);
1056
-      if (zz) SERIAL_ECHOPGM(MSG_Z);
1057
-      SERIAL_ECHOLNPGM(" " MSG_FIRST);
1058
-
1059
-      #if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
1060
-        ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : "");
1061
-      #endif
1062
-      return true;
1063
-    }
1064
-    return false;
1060
+    return true;
1065 1061
   }
1066
-
1067
-#endif // HAS_AXIS_UNHOMED_ERR
1062
+  return false;
1063
+}
1068 1064
 
1069 1065
 /**
1070 1066
  * Homing bump feedrate (mm/s)

+ 1
- 14
Marlin/src/module/motion.h View File

@@ -193,20 +193,7 @@ void clean_up_after_endstop_or_probe_move();
193 193
 // Homing
194 194
 //
195 195
 
196
-#define HAS_AXIS_UNHOMED_ERR (                                                     \
197
-         ENABLED(Z_PROBE_ALLEN_KEY)                                                \
198
-      || ENABLED(Z_PROBE_SLED)                                                     \
199
-      || HAS_PROBING_PROCEDURE                                                     \
200
-      || HOTENDS > 1                                                               \
201
-      || ENABLED(NOZZLE_CLEAN_FEATURE)                                             \
202
-      || ENABLED(NOZZLE_PARK_FEATURE)                                              \
203
-      || (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)) \
204
-      || HAS_M206_COMMAND                                                          \
205
-    ) || ENABLED(NO_MOTION_BEFORE_HOMING)
206
-
207
-#if HAS_AXIS_UNHOMED_ERR
208
-  bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);
209
-#endif
196
+bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);
210 197
 
211 198
 #if ENABLED(NO_MOTION_BEFORE_HOMING)
212 199
   #define MOTION_CONDITIONS (IsRunning() && !axis_unhomed_error())

Loading…
Cancel
Save