Browse Source

Allow float XY probe offsets

Responding to #12383

XY probe offsets should be integers because adding decimal points makes the code larger. But if decimals are very much wanted, this commit removes the old restriction.
Scott Lahteine 6 years ago
parent
commit
7ee5894360
2 changed files with 11 additions and 12 deletions
  1. 11
    9
      Marlin/src/core/utility.cpp
  2. 0
    3
      Marlin/src/inc/SanityCheck.h

+ 11
- 9
Marlin/src/core/utility.cpp View File

296
     #if HAS_BED_PROBE
296
     #if HAS_BED_PROBE
297
       SERIAL_ECHOPGM("Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER));
297
       SERIAL_ECHOPGM("Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER));
298
       SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
298
       SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
299
-      #if X_PROBE_OFFSET_FROM_EXTRUDER > 0
299
+      if ((X_PROBE_OFFSET_FROM_EXTRUDER) > 0)
300
         SERIAL_ECHOPGM(" (Right");
300
         SERIAL_ECHOPGM(" (Right");
301
-      #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0
301
+      else if ((X_PROBE_OFFSET_FROM_EXTRUDER) < 0)
302
         SERIAL_ECHOPGM(" (Left");
302
         SERIAL_ECHOPGM(" (Left");
303
-      #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0
303
+      else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) != 0)
304
         SERIAL_ECHOPGM(" (Middle");
304
         SERIAL_ECHOPGM(" (Middle");
305
-      #else
305
+      else
306
         SERIAL_ECHOPGM(" (Aligned With");
306
         SERIAL_ECHOPGM(" (Aligned With");
307
-      #endif
308
-      #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0
307
+
308
+      if ((Y_PROBE_OFFSET_FROM_EXTRUDER) > 0) {
309
         #if IS_SCARA
309
         #if IS_SCARA
310
           SERIAL_ECHOPGM("-Distal");
310
           SERIAL_ECHOPGM("-Distal");
311
         #else
311
         #else
312
           SERIAL_ECHOPGM("-Back");
312
           SERIAL_ECHOPGM("-Back");
313
         #endif
313
         #endif
314
-      #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0
314
+      }
315
+      else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) < 0) {
315
         #if IS_SCARA
316
         #if IS_SCARA
316
           SERIAL_ECHOPGM("-Proximal");
317
           SERIAL_ECHOPGM("-Proximal");
317
         #else
318
         #else
318
           SERIAL_ECHOPGM("-Front");
319
           SERIAL_ECHOPGM("-Front");
319
         #endif
320
         #endif
320
-      #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0
321
+      }
322
+      else if ((X_PROBE_OFFSET_FROM_EXTRUDER) != 0)
321
         SERIAL_ECHOPGM("-Center");
323
         SERIAL_ECHOPGM("-Center");
322
-      #endif
324
+
323
       if (zprobe_zoffset < 0)
325
       if (zprobe_zoffset < 0)
324
         SERIAL_ECHOPGM(" & Below");
326
         SERIAL_ECHOPGM(" & Below");
325
       else if (zprobe_zoffset > 0)
327
       else if (zprobe_zoffset > 0)

+ 0
- 3
Marlin/src/inc/SanityCheck.h View File

1009
     #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
1009
     #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
1010
   #endif
1010
   #endif
1011
 
1011
 
1012
-  static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value.");
1013
-  static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value.");
1014
-
1015
 #else
1012
 #else
1016
 
1013
 
1017
   /**
1014
   /**

Loading…
Cancel
Save