From 83278bdc17cb36682208f93188b7fade4afa57ab Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:40:57 +1300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Some=20boards=20with=20both=20LP?= =?UTF-8?q?C1768/9=20(#27586)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/lpc1768/env_validate.h | 15 ++++++++++----- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 1 + Marlin/src/pins/lpc1769/env_validate.h | 8 ++++++-- Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 1 + Marlin/src/pins/pins.h | 4 ++-- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Marlin/src/pins/lpc1768/env_validate.h b/Marlin/src/pins/lpc1768/env_validate.h index 8a6a1cebd3..a1b1dde128 100644 --- a/Marlin/src/pins/lpc1768/env_validate.h +++ b/Marlin/src/pins/lpc1768/env_validate.h @@ -22,12 +22,17 @@ #ifndef ENV_VALIDATE_H #define ENV_VALIDATE_H -#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769) - #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." -#elif DISABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1768) - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." +#if NOT_TARGET(MCU_LPC1768, MCU_LPC1769) + #if ENABLED(ALLOW_LPC1768_OR_9) + #error "Oops! Make sure you have the LPC1768 or LPC1769 environment selected in your IDE." + #elif ENABLED(REQUIRE_LPC1769) + #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." + #else + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." + #endif #endif +#undef ALLOW_LPC1768_OR_9 #undef REQUIRE_LPC1769 -#endif +#endif // ENV_VALIDATE_H diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 6bfc4c3c64..b028d49098 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -25,6 +25,7 @@ * Makerbase MKS SBASE pin assignments */ +#define ALLOW_LPC1768_OR_9 #include "env_validate.h" #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/lpc1769/env_validate.h b/Marlin/src/pins/lpc1769/env_validate.h index 0f62412453..1c6031a293 100644 --- a/Marlin/src/pins/lpc1769/env_validate.h +++ b/Marlin/src/pins/lpc1769/env_validate.h @@ -22,8 +22,12 @@ #ifndef ENV_VALIDATE_H #define ENV_VALIDATE_H -#if NOT_TARGET(MCU_LPC1769) +#if ENABLED(ALLOW_LPC1768_OR_9) && NOT_TARGET(MCU_LPC1768, MCU_LPC1769) + #error "Oops! Make sure you have the LPC1768 or LPC1769 environment selected in your IDE." +#elif NOT_TARGET(MCU_LPC1769) #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif -#endif +#undef ALLOW_LPC1768_OR_9 + +#endif // ENV_VALIDATE_H diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index fd9c1d94fd..062e572605 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -26,6 +26,7 @@ * See https://smoothieware.github.io/Webif-pack/documentation/web/html/smoothieboard.html */ +#define ALLOW_LPC1768_OR_9 #include "env_validate.h" #define BOARD_INFO_NAME "Smoothieboard" diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index eb26103380..aee437c245 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -458,7 +458,7 @@ #elif MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF) #include "lpc1768/pins_RAMPS_RE_ARM.h" // LPC1768 env:LPC1768 #elif MB(MKS_SBASE) - #include "lpc1768/pins_MKS_SBASE.h" // LPC1768 env:LPC1768 + #include "lpc1768/pins_MKS_SBASE.h" // LPC1768/9 env:LPC1768 env:LPC1769 #elif MB(AZSMZ_MINI) #include "lpc1768/pins_AZSMZ_MINI.h" // LPC1768 env:LPC1768 #elif MB(BIQU_BQ111_A4) @@ -497,7 +497,7 @@ #elif MB(COHESION3D_MINI) #include "lpc1769/pins_COHESION3D_MINI.h" // LPC1769 env:LPC1769 #elif MB(SMOOTHIEBOARD) - #include "lpc1769/pins_SMOOTHIEBOARD.h" // LPC1769 env:LPC1769 + #include "lpc1769/pins_SMOOTHIEBOARD.h" // LPC1768/9 env:LPC1768 env:LPC1769 #elif MB(TH3D_EZBOARD) #include "lpc1769/pins_TH3D_EZBOARD.h" // LPC1769 env:LPC1769 #elif MB(BTT_SKR_V1_4_TURBO)