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.
This commit is contained in:
Scott Lahteine 2018-11-17 07:36:39 -06:00
parent 43ecdb606f
commit 7ee5894360
2 changed files with 11 additions and 12 deletions

View File

@ -296,30 +296,32 @@ void safe_delay(millis_t ms) {
#if HAS_BED_PROBE #if HAS_BED_PROBE
SERIAL_ECHOPGM("Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER)); SERIAL_ECHOPGM("Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER));
SERIAL_ECHOPAIR(" Z:", zprobe_zoffset); SERIAL_ECHOPAIR(" Z:", zprobe_zoffset);
#if X_PROBE_OFFSET_FROM_EXTRUDER > 0 if ((X_PROBE_OFFSET_FROM_EXTRUDER) > 0)
SERIAL_ECHOPGM(" (Right"); SERIAL_ECHOPGM(" (Right");
#elif X_PROBE_OFFSET_FROM_EXTRUDER < 0 else if ((X_PROBE_OFFSET_FROM_EXTRUDER) < 0)
SERIAL_ECHOPGM(" (Left"); SERIAL_ECHOPGM(" (Left");
#elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0 else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) != 0)
SERIAL_ECHOPGM(" (Middle"); SERIAL_ECHOPGM(" (Middle");
#else else
SERIAL_ECHOPGM(" (Aligned With"); SERIAL_ECHOPGM(" (Aligned With");
#endif
#if Y_PROBE_OFFSET_FROM_EXTRUDER > 0 if ((Y_PROBE_OFFSET_FROM_EXTRUDER) > 0) {
#if IS_SCARA #if IS_SCARA
SERIAL_ECHOPGM("-Distal"); SERIAL_ECHOPGM("-Distal");
#else #else
SERIAL_ECHOPGM("-Back"); SERIAL_ECHOPGM("-Back");
#endif #endif
#elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0 }
else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) < 0) {
#if IS_SCARA #if IS_SCARA
SERIAL_ECHOPGM("-Proximal"); SERIAL_ECHOPGM("-Proximal");
#else #else
SERIAL_ECHOPGM("-Front"); SERIAL_ECHOPGM("-Front");
#endif #endif
#elif X_PROBE_OFFSET_FROM_EXTRUDER != 0 }
else if ((X_PROBE_OFFSET_FROM_EXTRUDER) != 0)
SERIAL_ECHOPGM("-Center"); SERIAL_ECHOPGM("-Center");
#endif
if (zprobe_zoffset < 0) if (zprobe_zoffset < 0)
SERIAL_ECHOPGM(" & Below"); SERIAL_ECHOPGM(" & Below");
else if (zprobe_zoffset > 0) else if (zprobe_zoffset > 0)

View File

@ -1009,9 +1009,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
#error "Z_PROBE_LOW_POINT must be less than or equal to 0." #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
#endif #endif
static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value.");
static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value.");
#else #else
/** /**