Sanity-check SERVO pin for servo probes

This commit is contained in:
Scott Lahteine 2018-08-30 18:33:06 -05:00
parent f58168a6f5
commit ca87e4c0fd

View File

@ -761,6 +761,14 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
#if HAS_Z_SERVO_PROBE
#ifndef NUM_SERVOS
#error "You must set NUM_SERVOS for a Z servo probe (Z_PROBE_SERVO_NR)."
#elif Z_PROBE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
#error "SERVO1_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR == 2 && !PIN_EXISTS(SERVO2)
#error "SERVO2_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your servo or BLTOUCH probe."
#elif Z_PROBE_SERVO_NR >= NUM_SERVOS
#error "Z_PROBE_SERVO_NR must be smaller than NUM_SERVOS."
#endif