Skip to content

Commit

Permalink
tailored error message
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 8, 2025
1 parent 4ef26df commit 354b08c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
14 changes: 6 additions & 8 deletions Marlin/src/pins/lpc1768/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if DISABLED(REQUIRE_EITHER_LPC1768_OR_LPC1769)
#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."
#endif
#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_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif

#undef REQUIRE_LPC1769
#undef REQUIRE_EITHER_LPC1768_OR_LPC1769
#undef ALLOW_LPC1768_OR_9

#endif // ENV_VALIDATE_H
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Makerbase MKS SBASE pin assignments
*/

#define REQUIRE_EITHER_LPC1768_OR_LPC1769
#define ALLOW_LPC1768_OR_9
#include "env_validate.h"

#ifndef BOARD_INFO_NAME
Expand Down
16 changes: 12 additions & 4 deletions Marlin/src/pins/lpc1769/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(MCU_LPC1769) && DISABLED(REQUIRE_EITHER_LPC1768_OR_LPC1769)
#error "Oops! Make sure you have the LPC1769 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 REQUIRE_EITHER_LPC1768_OR_LPC1769
#endif //ENV_VALIDATE_H
#undef REQUIRE_LPC1769
#undef ALLOW_LPC1768_OR_9

#endif // ENV_VALIDATE_H
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* See https://smoothieware.github.io/Webif-pack/documentation/web/html/smoothieboard.html
*/

#define REQUIRE_EITHER_LPC1768_OR_LPC1769
#define ALLOW_LPC1768_OR_9
#include "env_validate.h"

#define BOARD_INFO_NAME "Smoothieboard"
Expand Down

0 comments on commit 354b08c

Please sign in to comment.