From a63491e6ebb1bb41ae58d4f50f831eac952b4678 Mon Sep 17 00:00:00 2001 From: Chris Pepper Date: Fri, 29 Nov 2019 12:52:28 +0000 Subject: [PATCH] Sanity check ADC pins and FAST_PWM_FAN with Servos (#16038) --- Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h index e373aba00e..e8fadb878f 100644 --- a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h @@ -28,6 +28,35 @@ #error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries." #endif +/** + * Detect an old pins file by checking for old ADC pins values. + */ +#define _OLD_TEMP_PIN(P) PIN_EXISTS(TEMP_BED) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3 +#if _OLD_TEMP_PIN(TEMP_BED) + #error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_0) + #error "TEMP_0_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_1) + #error "TEMP_1_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_2) + #error "TEMP_2_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_3) + #error "TEMP_3_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_4) + #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_5) + #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#endif +#undef _OLD_TEMP_PIN + +/** + * Because PWM hardware channels all share the same frequency, along with the + * fallback software channels, FAST_PWM_FAN is incompatible with Servos. + */ +#if NUM_SERVOS > 0 && ENABLED(FAST_PWM_FAN) + #error "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards." +#endif + /** * Test LPC176x-specific configuration values for errors at compile-time. */