瀏覽代碼

Tweak tests, consolidate pins target validation (#21254)

Scott Lahteine 3 年之前
父節點
當前提交
3ea56ba4c7
No account linked to committer's email address
共有 100 個文件被更改,包括 400 次插入300 次删除
  1. 26
    0
      Marlin/src/pins/esp32/env_validate.h
  2. 3
    3
      Marlin/src/pins/esp32/pins_E4D.h
  3. 1
    3
      Marlin/src/pins/esp32/pins_ESP32.h
  4. 3
    3
      Marlin/src/pins/esp32/pins_FYSETC_E4.h
  5. 3
    3
      Marlin/src/pins/esp32/pins_MRR_ESPA.h
  6. 3
    3
      Marlin/src/pins/esp32/pins_MRR_ESPE.h
  7. 30
    0
      Marlin/src/pins/lpc1768/env_validate.h
  8. 1
    3
      Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
  9. 1
    3
      Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
  10. 1
    3
      Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
  11. 2
    4
      Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
  12. 1
    7
      Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
  13. 1
    3
      Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
  14. 1
    5
      Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
  15. 1
    3
      Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
  16. 1
    3
      Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
  17. 1
    3
      Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
  18. 26
    0
      Marlin/src/pins/lpc1769/env_validate.h
  19. 1
    3
      Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
  20. 1
    4
      Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
  21. 2
    4
      Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h
  22. 2
    0
      Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h
  23. 1
    1
      Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
  24. 1
    3
      Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
  25. 1
    3
      Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
  26. 1
    3
      Marlin/src/pins/lpc1769/pins_FLY_CDY.h
  27. 1
    5
      Marlin/src/pins/lpc1769/pins_MKS_SGEN.h
  28. 1
    3
      Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
  29. 1
    3
      Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
  30. 1
    3
      Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h
  31. 30
    0
      Marlin/src/pins/mega/env_validate.h
  32. 1
    3
      Marlin/src/pins/mega/pins_CHEAPTRONIC.h
  33. 1
    3
      Marlin/src/pins/mega/pins_CHEAPTRONICv2.h
  34. 2
    3
      Marlin/src/pins/mega/pins_CNCONTROLS_11.h
  35. 2
    3
      Marlin/src/pins/mega/pins_CNCONTROLS_12.h
  36. 2
    3
      Marlin/src/pins/mega/pins_CNCONTROLS_15.h
  37. 2
    3
      Marlin/src/pins/mega/pins_EINSTART-S.h
  38. 1
    3
      Marlin/src/pins/mega/pins_ELEFU_3.h
  39. 2
    3
      Marlin/src/pins/mega/pins_GT2560_REV_A.h
  40. 2
    3
      Marlin/src/pins/mega/pins_GT2560_V3.h
  41. 1
    3
      Marlin/src/pins/mega/pins_HJC2560C_REV2.h
  42. 1
    3
      Marlin/src/pins/mega/pins_INTAMSYS40.h
  43. 2
    3
      Marlin/src/pins/mega/pins_LEAPFROG.h
  44. 1
    3
      Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h
  45. 3
    3
      Marlin/src/pins/mega/pins_MEGACONTROLLER.h
  46. 1
    3
      Marlin/src/pins/mega/pins_MEGATRONICS.h
  47. 1
    3
      Marlin/src/pins/mega/pins_MEGATRONICS_2.h
  48. 1
    3
      Marlin/src/pins/mega/pins_MEGATRONICS_3.h
  49. 2
    3
      Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
  50. 3
    3
      Marlin/src/pins/mega/pins_OVERLORD.h
  51. 2
    4
      Marlin/src/pins/mega/pins_PICA.h
  52. 1
    3
      Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h
  53. 1
    1
      Marlin/src/pins/pins.h
  54. 2
    2
      Marlin/src/pins/pinsDebug.h
  55. 26
    0
      Marlin/src/pins/rambo/env_validate.h
  56. 1
    3
      Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
  57. 1
    3
      Marlin/src/pins/rambo/pins_EINSY_RETRO.h
  58. 1
    3
      Marlin/src/pins/rambo/pins_MINIRAMBO.h
  59. 1
    3
      Marlin/src/pins/rambo/pins_RAMBO.h
  60. 1
    3
      Marlin/src/pins/rambo/pins_SCOOVO_X9H.h
  61. 35
    0
      Marlin/src/pins/ramps/env_validate.h
  62. 4
    3
      Marlin/src/pins/ramps/pins_AZTEEG_X3.h
  63. 4
    3
      Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h
  64. 2
    3
      Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h
  65. 2
    3
      Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
  66. 4
    3
      Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h
  67. 4
    3
      Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h
  68. 4
    3
      Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h
  69. 1
    3
      Marlin/src/pins/ramps/pins_K8800.h
  70. 4
    6
      Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h
  71. 1
    12
      Marlin/src/pins/ramps/pins_RAMPS.h
  72. 1
    3
      Marlin/src/pins/ramps/pins_RAMPS_OLD.h
  73. 1
    3
      Marlin/src/pins/ramps/pins_RAMPS_PLUS.h
  74. 1
    6
      Marlin/src/pins/ramps/pins_RAMPS_S_12.h
  75. 4
    3
      Marlin/src/pins/ramps/pins_RUMBA.h
  76. 4
    3
      Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h
  77. 4
    3
      Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h
  78. 1
    3
      Marlin/src/pins/ramps/pins_TT_OSCAR.h
  79. 2
    3
      Marlin/src/pins/ramps/pins_ULTIMAIN_2.h
  80. 1
    3
      Marlin/src/pins/ramps/pins_ULTIMAKER.h
  81. 1
    3
      Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
  82. 4
    3
      Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
  83. 33
    0
      Marlin/src/pins/sam/env_validate.h
  84. 3
    3
      Marlin/src/pins/sam/pins_ADSK.h
  85. 1
    3
      Marlin/src/pins/sam/pins_ALLIGATOR_R2.h
  86. 1
    3
      Marlin/src/pins/sam/pins_CNCONTROLS_15D.h
  87. 1
    3
      Marlin/src/pins/sam/pins_DUE3DOM.h
  88. 1
    3
      Marlin/src/pins/sam/pins_DUE3DOM_MINI.h
  89. 1
    3
      Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h
  90. 1
    3
      Marlin/src/pins/sam/pins_RADDS.h
  91. 1
    6
      Marlin/src/pins/sam/pins_RAMPS4DUE.h
  92. 1
    6
      Marlin/src/pins/sam/pins_RAMPS_DUO.h
  93. 1
    3
      Marlin/src/pins/sam/pins_RAMPS_FD_V1.h
  94. 1
    5
      Marlin/src/pins/sam/pins_RAMPS_SMART.h
  95. 1
    3
      Marlin/src/pins/sam/pins_RURAMPS4D_11.h
  96. 1
    3
      Marlin/src/pins/sam/pins_RURAMPS4D_13.h
  97. 1
    3
      Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h
  98. 42
    0
      Marlin/src/pins/sanguino/env_validate.h
  99. 2
    3
      Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h
  100. 0
    0
      Marlin/src/pins/sanguino/pins_GEN3_PLUS.h

+ 26
- 0
Marlin/src/pins/esp32/env_validate.h 查看文件

@@ -0,0 +1,26 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if NOT_TARGET(ARDUINO_ARCH_ESP32)
25
+  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
26
+#endif

+ 3
- 3
Marlin/src/pins/esp32/pins_E4D.h 查看文件

@@ -27,9 +27,9 @@
27 27
  * for more info check https://atbox.tech/ and join to Facebook page E4d@box.
28 28
  */
29 29
 
30
-#if NOT_TARGET(ARDUINO_ARCH_ESP32)
31
-  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
32
-#elif EXTRUDERS > 1 || E_STEPPERS > 1
30
+#include "env_validate.h"
31
+
32
+#if EXTRUDERS > 1 || E_STEPPERS > 1
33 33
   #error "E4d@box only supports one E Stepper. Comment out this line to continue."
34 34
 #elif HOTENDS > 1
35 35
   #error "E4d@box only supports one hotend / E-stepper. Comment out this line to continue."

+ 1
- 3
Marlin/src/pins/esp32/pins_ESP32.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Espressif ESP32 (Tensilica Xtensa LX6) pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(ARDUINO_ARCH_ESP32)
29
-  "Oops! Select an ESP32 board in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Espressif ESP32"
33 31
 

+ 3
- 3
Marlin/src/pins/esp32/pins_FYSETC_E4.h 查看文件

@@ -27,9 +27,9 @@
27 27
  * Supports 4 stepper drivers, heated bed, single hotend.
28 28
  */
29 29
 
30
-#ifndef ARDUINO_ARCH_ESP32
31
-  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
32
-#elif EXTRUDERS > 1 || E_STEPPERS > 1
30
+#include "env_validate.h"
31
+
32
+#if EXTRUDERS > 1 || E_STEPPERS > 1
33 33
   #error "FYSETC E4 only supports one E Stepper. Comment out this line to continue."
34 34
 #elif HOTENDS > 1
35 35
   #error "FYSETC E4 only supports one hotend / E-stepper. Comment out this line to continue."

+ 3
- 3
Marlin/src/pins/esp32/pins_MRR_ESPA.h 查看文件

@@ -27,9 +27,9 @@
27 27
  * Supports 4 stepper drivers, heated bed, single hotend.
28 28
  */
29 29
 
30
-#if NOT_TARGET(ARDUINO_ARCH_ESP32)
31
-  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
32
-#elif EXTRUDERS > 1 || E_STEPPERS > 1
30
+#include "env_validate.h"
31
+
32
+#if EXTRUDERS > 1 || E_STEPPERS > 1
33 33
   #error "MRR ESPA only supports one E Stepper. Comment out this line to continue."
34 34
 #elif HOTENDS > 1
35 35
   #error "MRR ESPA only supports one hotend / E-stepper. Comment out this line to continue."

+ 3
- 3
Marlin/src/pins/esp32/pins_MRR_ESPE.h 查看文件

@@ -28,9 +28,9 @@
28 28
  * single hotend, and LCD controller.
29 29
  */
30 30
 
31
-#if NOT_TARGET(ARDUINO_ARCH_ESP32)
32
-  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
33
-#elif EXTRUDERS > 2 || E_STEPPERS > 2
31
+#include "env_validate.h"
32
+
33
+#if EXTRUDERS > 2 || E_STEPPERS > 2
34 34
   #error "MRR ESPE only supports two E Steppers. Comment out this line to continue."
35 35
 #elif HOTENDS > 1
36 36
   #error "MRR ESPE only supports one hotend / E-stepper. Comment out this line to continue."

+ 30
- 0
Marlin/src/pins/lpc1768/env_validate.h 查看文件

@@ -0,0 +1,30 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769)
25
+  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
26
+#elif DISABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1768)
27
+  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
28
+#endif
29
+
30
+#undef REQUIRE_LPC1769

+ 1
- 3
Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * AZSMZ MINI pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1768)
29
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "AZSMZ MINI"
33 31
 

+ 1
- 3
Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h 查看文件

@@ -29,9 +29,7 @@
29 29
  *  BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
30 30
  */
31 31
 
32
-#if NOT_TARGET(MCU_LPC1768)
33
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
34
-#endif
32
+#include "env_validate.h"
35 33
 
36 34
 #ifndef BOARD_INFO_NAME
37 35
   #define BOARD_INFO_NAME "BIQU Thunder B300 V1.0"

+ 1
- 3
Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h 查看文件

@@ -29,9 +29,7 @@
29 29
  *  BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
30 30
  */
31 31
 
32
-#if NOT_TARGET(MCU_LPC1768)
33
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
34
-#endif
32
+#include "env_validate.h"
35 33
 
36 34
 #define BOARD_INFO_NAME "BIQU BQ111-A4"
37 35
 

+ 2
- 4
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h 查看文件

@@ -21,14 +21,12 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include "env_validate.h"
25
+
24 26
 #ifndef BOARD_INFO_NAME
25 27
   #define BOARD_INFO_NAME "BTT SKR V1.4"
26 28
 #endif
27 29
 
28
-#ifndef BOARD_CUSTOM_BUILD_FLAGS
29
-  #define BOARD_CUSTOM_BUILD_FLAGS -DLPC_PINCFG_UART3_P4_28
30
-#endif
31
-
32 30
 //
33 31
 // SD Connection
34 32
 //

+ 1
- 7
Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h 查看文件

@@ -21,13 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#if ENABLED(SKR_HAS_LPC1769)
25
-  #if NOT_TARGET(MCU_LPC1769)
26
-    #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
27
-  #endif
28
-#elif NOT_TARGET(MCU_LPC1768)
29
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
30
-#endif
24
+#include "env_validate.h"
31 25
 
32 26
 // If you have the Big tree tech driver expansion module, enable HAS_BTT_EXP_MOT
33 27
 // https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT

+ 1
- 3
Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h 查看文件

@@ -21,9 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#if NOT_TARGET(MCU_LPC1768)
25
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
26
-#endif
24
+#include "env_validate.h"
27 25
 
28 26
 #define BOARD_INFO_NAME "GMARSH X6 REV1"
29 27
 

+ 1
- 5
Marlin/src/pins/lpc1768/pins_MKS_SBASE.h 查看文件

@@ -25,11 +25,7 @@
25 25
  * MKS SBASE pin assignments
26 26
  */
27 27
 
28
-#if defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#elif !defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1768)
31
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
32
-#endif
28
+#include "env_validate.h"
33 29
 
34 30
 #ifndef BOARD_INFO_NAME
35 31
   #define BOARD_INFO_NAME   "MKS SBASE"

+ 1
- 3
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * MKS SGEN-L pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1768)
29
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME   "MKS SGen-L"
33 31
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L"

+ 1
- 3
Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h 查看文件

@@ -35,9 +35,7 @@
35 35
 
36 36
 // Numbers in parentheses () are the corresponding mega2560 pin numbers
37 37
 
38
-#if NOT_TARGET(MCU_LPC1768)
39
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
40
-#endif
38
+#include "env_validate.h"
41 39
 
42 40
 #define BOARD_INFO_NAME "Re-ARM RAMPS 1.4"
43 41
 

+ 1
- 3
Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Selena Compact pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1768)
29
-  #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME   "Selena Compact"
33 31
 #define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena"

+ 26
- 0
Marlin/src/pins/lpc1769/env_validate.h 查看文件

@@ -0,0 +1,26 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if NOT_TARGET(MCU_LPC1769)
25
+  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
26
+#endif

+ 1
- 3
Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Azteeg X5 GT pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME   "Azteeg X5 GT"
33 31
 #define BOARD_WEBSITE_URL "tinyurl.com/yx8tdqa3"

+ 1
- 4
Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h 查看文件

@@ -24,10 +24,7 @@
24 24
 /**
25 25
  * Azteeg X5 MINI pin assignments
26 26
  */
27
-
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
27
+#include "env_validate.h"
31 28
 
32 29
 #ifndef BOARD_INFO_NAME
33 30
   #define BOARD_INFO_NAME "Azteeg X5 MINI"

+ 2
- 4
Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h 查看文件

@@ -22,12 +22,10 @@
22 22
 #pragma once
23 23
 
24 24
 /**
25
- * Azteeg X5 MINI pin assignments
25
+ * Azteeg X5 MINI WIFI pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Azteeg X5 MINI WIFI"
33 31
 

+ 2
- 0
Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h 查看文件

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include "env_validate.h"
25
+
24 26
 #ifndef BOARD_INFO_NAME
25 27
   #define BOARD_INFO_NAME "BTT SKR E3 Turbo"
26 28
 #endif

+ 1
- 1
Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h 查看文件

@@ -22,9 +22,9 @@
22 22
 #pragma once
23 23
 
24 24
 #define BOARD_INFO_NAME "BTT SKR V1.4 TURBO"
25
-#define SKR_HAS_LPC1769
26 25
 
27 26
 //
28 27
 // Include SKR 1.4 pins
29 28
 //
29
+#define REQUIRE_LPC1769
30 30
 #include "../lpc1768/pins_BTT_SKR_V1_4.h"

+ 1
- 3
Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Cohesion3D Mini pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Cohesion3D Mini"
33 31
 

+ 1
- 3
Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Cohesion3D ReMix pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Cohesion3D ReMix"
33 31
 

+ 1
- 3
Marlin/src/pins/lpc1769/pins_FLY_CDY.h 查看文件

@@ -21,9 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#if NOT_TARGET(MCU_LPC1769)
25
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
26
-#endif
24
+#include "env_validate.h"
27 25
 
28 26
 #define BOARD_INFO_NAME   "FLY-CDY"
29 27
 #define BOARD_WEBSITE_URL "github.com/FLYmaker/FLY-CDY"

+ 1
- 5
Marlin/src/pins/lpc1769/pins_MKS_SGEN.h 查看文件

@@ -28,14 +28,10 @@
28 28
  * https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20PIN.pdf
29 29
  */
30 30
 
31
-#if NOT_TARGET(MCU_LPC1769)
32
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
33
-#endif
34
-
35 31
 #define BOARD_INFO_NAME   "MKS SGen"
36 32
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN"
37 33
 
38
-#define MKS_HAS_LPC1769
34
+#define REQUIRE_LPC1769
39 35
 #include "../lpc1768/pins_MKS_SBASE.h"
40 36
 
41 37
 #if HAS_TMC_UART

+ 1
- 3
Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * MKS SGen pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME   "MKS SGEN_L V2"
33 31
 #define BOARD_WEBSITE_URL "github.com/makerbase-mks"

+ 1
- 3
Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Smoothieboard pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME   "Smoothieboard"
33 31
 #define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard"

+ 1
- 3
Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * TH3D EZBoard pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(MCU_LPC1769)
29
-  #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME   "TH3D EZBoard"
33 31
 #define BOARD_WEBSITE_URL "th3dstudio.com"

+ 30
- 0
Marlin/src/pins/mega/env_validate.h 查看文件

@@ -0,0 +1,30 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if ENABLED(ALLOW_MEGA1280) && NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
25
+  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560 or 1280' in 'Tools > Board.'"
26
+#elif NOT_TARGET(__AVR_ATmega2560__)
27
+  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
28
+#endif
29
+
30
+#undef ALLOW_MEGA1280

+ 1
- 3
Marlin/src/pins/mega/pins_CHEAPTRONIC.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Cheaptronic v1.0 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Cheaptronic v1.0"
33 31
 //

+ 1
- 3
Marlin/src/pins/mega/pins_CHEAPTRONICv2.h 查看文件

@@ -27,9 +27,7 @@
27 27
  *          www.reprapobchod.cz
28 28
  */
29 29
 
30
-#if NOT_TARGET(__AVR_ATmega2560__)
31
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
32
-#endif
30
+#include "env_validate.h"
33 31
 
34 32
 #define BOARD_INFO_NAME "Cheaptronic v2.0"
35 33
 

+ 2
- 3
Marlin/src/pins/mega/pins_CNCONTROLS_11.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * CartesioV11 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define ALLOW_MEGA1280
29
+#include "env_validate.h"
31 30
 
32 31
 #define BOARD_INFO_NAME "CN Controls V11"
33 32
 

+ 2
- 3
Marlin/src/pins/mega/pins_CNCONTROLS_12.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * CartesioV12 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define ALLOW_MEGA1280
29
+#include "env_validate.h"
31 30
 
32 31
 #define BOARD_INFO_NAME "CN Controls V12"
33 32
 

+ 2
- 3
Marlin/src/pins/mega/pins_CNCONTROLS_15.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * CNControls V15 for HMS434 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define ALLOW_MEGA1280
29
+#include "env_validate.h"
31 30
 
32 31
 #define BOARD_INFO_NAME "CN Controls V15"
33 32
 

+ 2
- 3
Marlin/src/pins/mega/pins_EINSTART-S.h 查看文件

@@ -26,9 +26,8 @@
26 26
  * PCB Silkscreen: 3DPrinterCon_v3.5
27 27
  */
28 28
 
29
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
30
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
31
-#endif
29
+#define ALLOW_MEGA1280
30
+#include "env_validate.h"
32 31
 
33 32
 #define BOARD_INFO_NAME "Einstart-S"
34 33
 

+ 1
- 3
Marlin/src/pins/mega/pins_ELEFU_3.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Elefu RA Board Pin Assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Elefu Ra v3"
33 31
 

+ 2
- 3
Marlin/src/pins/mega/pins_GT2560_REV_A.h 查看文件

@@ -27,9 +27,8 @@
27 27
  * Richard Smith <galorin@gmail.com>
28 28
  */
29 29
 
30
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
31
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
32
-#endif
30
+#define ALLOW_MEGA1280
31
+#include "env_validate.h"
33 32
 
34 33
 #ifndef BOARD_INFO_NAME
35 34
   #define BOARD_INFO_NAME "GT2560 Rev.A"

+ 2
- 3
Marlin/src/pins/mega/pins_GT2560_V3.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * Geeetech GT2560 RevB + GT2560 3.0/3.1 + GT2560 4.0/4.1 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define ALLOW_MEGA1280
29
+#include "env_validate.h"
31 30
 
32 31
 #ifndef BOARD_INFO_NAME
33 32
   #define BOARD_INFO_NAME "GT2560 RevB/3.x/4.x"

+ 1
- 3
Marlin/src/pins/mega/pins_HJC2560C_REV2.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Geeetech HJC2560-C Rev 2.x board pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define DEFAULT_MACHINE_NAME "ADIMLab Gantry v2"
33 31
 #define BOARD_INFO_NAME      "HJC2560-C"

+ 1
- 3
Marlin/src/pins/mega/pins_INTAMSYS40.h 查看文件

@@ -27,9 +27,7 @@
27 27
  * 2208 version exists and may or may not work
28 28
  */
29 29
 
30
-#if NOT_TARGET(__AVR_ATmega2560__)
31
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
32
-#endif
30
+#include "env_validate.h"
33 31
 
34 32
 #define BOARD_INFO_NAME "Intamsys 4.0"
35 33
 

+ 2
- 3
Marlin/src/pins/mega/pins_LEAPFROG.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * Leapfrog Driver board pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define ALLOW_MEGA1280
29
+#include "env_validate.h"
31 30
 
32 31
 #define BOARD_INFO_NAME "Leapfrog"
33 32
 

+ 1
- 3
Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h 查看文件

@@ -29,9 +29,7 @@
29 29
  * printer models. As such this file is currently specific to the Xeed.
30 30
  */
31 31
 
32
-#if NOT_TARGET(__AVR_ATmega2560__)
33
-  #error "Oops! Select 'Mega 2560' in 'Tools > Board.'"
34
-#endif
32
+#include "env_validate.h"
35 33
 
36 34
 #define BOARD_INFO_NAME "Leapfrog Xeed 2015"
37 35
 

+ 3
- 3
Marlin/src/pins/mega/pins_MEGACONTROLLER.h 查看文件

@@ -25,12 +25,12 @@
25 25
  * Mega controller pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#if HOTENDS > 2 || E_STEPPERS > 2
31 29
   #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 30
 #endif
33 31
 
32
+#include "env_validate.h"
33
+
34 34
 #define BOARD_INFO_NAME "Mega Controller"
35 35
 
36 36
 //

+ 1
- 3
Marlin/src/pins/mega/pins_MEGATRONICS.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * MegaTronics pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Megatronics"
33 31
 //

+ 1
- 3
Marlin/src/pins/mega/pins_MEGATRONICS_2.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * MegaTronics v2.0 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Megatronics v2.0"
33 31
 //

+ 1
- 3
Marlin/src/pins/mega/pins_MEGATRONICS_3.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * MegaTronics v3.0 / v3.1 / v3.2 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #if MB(MEGATRONICS_32)
33 31
   #define BOARD_INFO_NAME "Megatronics v3.2"

+ 2
- 3
Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h 查看文件

@@ -37,9 +37,8 @@
37 37
  *  number (B5) agrees with the schematic but B5 is assigned to logical pin 11.
38 38
  */
39 39
 
40
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
41
-  #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'"
42
-#endif
40
+#define ALLOW_MEGA1280
41
+#include "env_validate.h"
43 42
 
44 43
 #define BOARD_INFO_NAME      "Mightyboard"
45 44
 #define DEFAULT_MACHINE_NAME "MB Replicator"

+ 3
- 3
Marlin/src/pins/mega/pins_OVERLORD.h 查看文件

@@ -25,12 +25,12 @@
25 25
  * Dreammaker Overlord v1.1 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#if HOTENDS > 2 || E_STEPPERS > 2
31 29
   #error "Overlord Controller supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 30
 #endif
33 31
 
32
+#include "env_validate.h"
33
+
34 34
 #define BOARD_INFO_NAME         "OVERLORD"
35 35
 #define DEFAULT_MACHINE_NAME    BOARD_INFO_NAME
36 36
 

+ 2
- 4
Marlin/src/pins/mega/pins_PICA.h 查看文件

@@ -29,6 +29,8 @@
29 29
  * Applies to PICA, PICA_REVB
30 30
  */
31 31
 
32
+#include "env_validate.h"
33
+
32 34
 #ifndef BOARD_INFO_NAME
33 35
   #define BOARD_INFO_NAME "PICA"
34 36
 #endif
@@ -42,10 +44,6 @@
42 44
   AD12 = 66;  AD13 = 67;  AD14 = 68;  AD15 = 69;
43 45
 */
44 46
 
45
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
46
-  #error "Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."
47
-#endif
48
-
49 47
 //
50 48
 // Servos
51 49
 //

+ 1
- 3
Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Wanhao 0ne+ pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME      "Wanhao i3 Mini 0ne+"
33 31
 #define DEFAULT_MACHINE_NAME "i3 Mini"

+ 1
- 1
Marlin/src/pins/pins.h 查看文件

@@ -378,7 +378,7 @@
378 378
 #elif MB(BTT_SKR_V1_3)
379 379
   #include "lpc1768/pins_BTT_SKR_V1_3.h"        // LPC1768                                env:LPC1768
380 380
 #elif MB(BTT_SKR_V1_4)
381
-  #include "lpc1768/pins_BTT_SKR_V1_4.h"        // LPC1768                                env:LPC1768
381
+  #include "lpc1768/pins_BTT_SKR_V1_4.h"        // LPC1768                                env:LPC1768_btt_skr_v1_4
382 382
 
383 383
 //
384 384
 // LPC1769 ARM Cortex M3

+ 2
- 2
Marlin/src/pins/pinsDebug.h 查看文件

@@ -41,7 +41,7 @@
41 41
 #define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(#NAME, COUNTER)
42 42
 
43 43
 #include "pinsDebug_list.h"
44
-#line 46
44
+#line 45
45 45
 
46 46
 // manually add pins that have names that are macros which don't play well with these macros
47 47
 #if ANY(AVR_ATmega2560_FAMILY, AVR_ATmega1284_FAMILY, ARDUINO_ARCH_SAM, TARGET_LPC1768)
@@ -227,7 +227,7 @@ const PinInfo pin_array[] PROGMEM = {
227 227
   #endif
228 228
 
229 229
   #include "pinsDebug_list.h"
230
-  #line 172
230
+  #line 231
231 231
 
232 232
 };
233 233
 

+ 26
- 0
Marlin/src/pins/rambo/env_validate.h 查看文件

@@ -0,0 +1,26 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if NOT_TARGET(__AVR_ATmega2560__)
25
+  #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'"
26
+#endif

+ 1
- 3
Marlin/src/pins/rambo/pins_EINSY_RAMBO.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Einsy-Rambo pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Einsy Rambo"
33 31
 

+ 1
- 3
Marlin/src/pins/rambo/pins_EINSY_RETRO.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Einsy-Retro pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Einsy Retro"
33 31
 

+ 1
- 3
Marlin/src/pins/rambo/pins_MINIRAMBO.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Mini-RAMBo pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'RAMBo' in 'Tools > Board' or the Mega2560 environment in PlatformIO."
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #if MB(MINIRAMBO_10A)
33 31
   #define BOARD_INFO_NAME "Mini RAMBo 1.0a"

+ 1
- 3
Marlin/src/pins/rambo/pins_RAMBO.h 查看文件

@@ -41,9 +41,7 @@
41 41
  * Rambo pin assignments
42 42
  */
43 43
 
44
-#if NOT_TARGET(__AVR_ATmega2560__)
45
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
46
-#endif
44
+#include "env_validate.h"
47 45
 
48 46
 #ifndef BOARD_INFO_NAME
49 47
   #define BOARD_INFO_NAME "Rambo"

+ 1
- 3
Marlin/src/pins/rambo/pins_SCOOVO_X9H.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Rambo pin assignments MODIFIED FOR Scoovo X9H
26 26
  ************************************************/
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_target.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "Scoovo X9H"
33 31
 

+ 35
- 0
Marlin/src/pins/ramps/env_validate.h 查看文件

@@ -0,0 +1,35 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if ENABLED(ALLOW_SAM3X8E)
25
+  #if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
26
+    #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
27
+  #endif
28
+#elif ENABLED(REQUIRE_MEGA2560) && NOT_TARGET(__AVR_ATmega2560__)
29
+  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
+#elif DISABLED(REQUIRE_MEGA2560) && NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
31
+  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560 or 1280' in 'Tools > Board.'"
32
+#endif
33
+
34
+#undef ALLOW_SAM3X8E
35
+#undef REQUIRE_MEGA2560

+ 4
- 3
Marlin/src/pins/ramps/pins_AZTEEG_X3.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 2 || E_STEPPERS > 2
31 32
   #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 4
- 3
Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * AZTEEG_X3_PRO (Arduino Mega) pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 5 || E_STEPPERS > 5
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 5 || E_STEPPERS > 5
31 32
   #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 2
- 3
Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * bq ZUM Mega 3D board definition
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
31 30
 
32 31
 #define BOARD_INFO_NAME "ZUM Mega 3D"
33 32
 

+ 2
- 3
Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h 查看文件

@@ -25,9 +25,8 @@
25 25
  * Wanhao Duplicator i3 Plus pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
31 30
 
32 31
 #define BOARD_INFO_NAME "Duplicator i3 Plus"
33 32
 

+ 4
- 3
Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * Formbot Raptor pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 3 || E_STEPPERS > 3
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 3 || E_STEPPERS > 3
31 32
   #error "Formbot supports up to 3 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 4
- 3
Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * Formbot pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 2 || E_STEPPERS > 2
31 32
   #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 4
- 3
Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * Formbot pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 2 || E_STEPPERS > 2
31 32
   #error "Formbot supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 1
- 3
Marlin/src/pins/ramps/pins_K8800.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Velleman K8800 (Vertex)
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME      "K8800"
33 31
 #define DEFAULT_MACHINE_NAME "Vertex Delta"

+ 4
- 6
Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * Longer3D LK1/LK4/LK5 Pro board pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 1 || E_STEPPERS > 1
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 1 || E_STEPPERS > 1
31 32
   #error "Longer3D LGT KIT V1.0 board only supports one hotend / E-stepper. Comment out this line to continue."
32 33
 #endif
33 34
 
@@ -42,9 +43,6 @@
42 43
   #warning "Serial 3 is originally reserved to Y limit switches. Hardware changes are required to use it."
43 44
 #endif
44 45
 
45
-// Custom flags and defines for the build
46
-//#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__
47
-
48 46
 #define BOARD_INFO_NAME "LGT KIT V1.0"
49 47
 
50 48
 //

+ 1
- 12
Marlin/src/pins/ramps/pins_RAMPS.h 查看文件

@@ -45,18 +45,7 @@
45 45
  *         7 | 11
46 46
  */
47 47
 
48
-#ifdef TARGET_LPC1768
49
-  #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768."
50
-#elif defined(__STM32F1__)
51
-  #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1."
52
-#endif
53
-
54
-#if NOT_TARGET(IS_RAMPS_SMART, IS_RAMPS_DUO, IS_RAMPS4DUE, TARGET_LPC1768, __AVR_ATmega1280__, __AVR_ATmega2560__)
55
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' (or other appropriate target) in 'Tools > Board.'"
56
-#endif
57
-
58
-// Custom flags and defines for the build
59
-//#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__
48
+#include "env_validate.h"
60 49
 
61 50
 #ifndef BOARD_INFO_NAME
62 51
   #define BOARD_INFO_NAME "RAMPS 1.4"

+ 1
- 3
Marlin/src/pins/ramps/pins_RAMPS_OLD.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * Arduino Mega with RAMPS v1.0, v1.1, v1.2 pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "RAMPS <1.2"
33 31
 

+ 1
- 3
Marlin/src/pins/ramps/pins_RAMPS_PLUS.h 查看文件

@@ -37,9 +37,7 @@
37 37
  *  RAMPS_PLUS_SF  (Spindle, Controller Fan)
38 38
  */
39 39
 
40
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
41
- #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
42
-#endif
40
+#include "env_validate.h"
43 41
 
44 42
 #define BOARD_INFO_NAME "RAMPS 1.4 Plus"
45 43
 

+ 1
- 6
Marlin/src/pins/ramps/pins_RAMPS_S_12.h 查看文件

@@ -34,12 +34,7 @@
34 34
  * Other pins_MYBOARD.h files may override these defaults
35 35
  */
36 36
 
37
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
38
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
39
-#endif
40
-
41
-// Custom flags and defines for the build
42
-//#define BOARD_CUSTOM_BUILD_FLAGS -D__FOO__
37
+#include "env_validate.h"
43 38
 
44 39
 #ifndef BOARD_INFO_NAME
45 40
   #define BOARD_INFO_NAME "RAMPS S 1.2"

+ 4
- 3
Marlin/src/pins/ramps/pins_RUMBA.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * RUMBA pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 3 || E_STEPPERS > 3
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 3 || E_STEPPERS > 3
31 32
   #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 4
- 3
Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * Tenlog pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 2 || E_STEPPERS > 2
31 32
   #error "Tenlog supports up to 2 hotends / E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 4
- 3
Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h 查看文件

@@ -25,9 +25,10 @@
25 25
  * Arduino Mega for Tronxy X5S-2E, etc.
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 2 || E_STEPPERS > 2
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 2 || E_STEPPERS > 2
31 32
   #error "TRONXY-V3-1.0 supports only 2 hotends/E-steppers. Comment out this line to continue."
32 33
 #endif
33 34
 

+ 1
- 3
Marlin/src/pins/ramps/pins_TT_OSCAR.h 查看文件

@@ -20,9 +20,7 @@
20 20
  *
21 21
  */
22 22
 
23
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
24
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
25
-#endif
23
+#include "env_validate.h"
26 24
 
27 25
 #if HOTENDS > 5 || E_STEPPERS > 5
28 26
   #error "TTOSCAR supports up to 5 hotends / E-steppers. Comment out this line to continue."

+ 2
- 3
Marlin/src/pins/ramps/pins_ULTIMAIN_2.h 查看文件

@@ -33,9 +33,8 @@
33 33
  *    case light
34 34
  */
35 35
 
36
-#if NOT_TARGET(__AVR_ATmega2560__)
37
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
38
-#endif
36
+#define REQUIRE_MEGA2560
37
+#include "env_validate.h"
39 38
 
40 39
 #define BOARD_INFO_NAME         "Ultimaker 2.x"
41 40
 #define DEFAULT_MACHINE_NAME    "Ultimaker"

+ 1
- 3
Marlin/src/pins/ramps/pins_ULTIMAKER.h 查看文件

@@ -33,9 +33,7 @@
33 33
  *    case light
34 34
  */
35 35
 
36
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
37
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
38
-#endif
36
+#include "env_validate.h"
39 37
 
40 38
 #define BOARD_INFO_NAME         "Ultimaker"
41 39
 #define DEFAULT_MACHINE_NAME    BOARD_INFO_NAME

+ 1
- 3
Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h 查看文件

@@ -60,9 +60,7 @@
60 60
 //#define BOARD_REV_1_0
61 61
 //#define BOARD_REV_1_5
62 62
 
63
-#if NOT_TARGET(__AVR_ATmega1280__, __AVR_ATmega2560__)
64
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
65
-#endif
63
+#include "env_validate.h"
66 64
 
67 65
 #ifdef BOARD_REV_1_1_TO_1_3
68 66
   #define BOARD_INFO_NAME       "Ultimaker 1.1-1.3"

+ 4
- 3
Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h 查看文件

@@ -25,9 +25,10 @@
25 25
  *  Z-Bolt X Series board – based on Arduino Mega2560
26 26
  */
27 27
 
28
-#if NOT_TARGET(__AVR_ATmega2560__)
29
-  #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
30
-#elif HOTENDS > 4 || E_STEPPERS > 4
28
+#define REQUIRE_MEGA2560
29
+#include "env_validate.h"
30
+
31
+#if HOTENDS > 4 || E_STEPPERS > 4
31 32
   #error "Z-Bolt X Series board supports up to 4 hotends / E-steppers."
32 33
 #endif
33 34
 

+ 33
- 0
Marlin/src/pins/sam/env_validate.h 查看文件

@@ -0,0 +1,33 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if BOTH(ALLOW_MEGA1280, ALLOW_MEGA2560) && NOT_TARGET(__SAM3X8E__, __AVR_ATmega1280__, __AVR_ATmega2560__)
25
+  #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
26
+#elif ENABLED(ALLOW_MEGA2560) && NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
27
+  #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
28
+#elif ENABLED(ALLOW_MEGA1280) && NOT_TARGET(__SAM3X8E__, __AVR_ATmega1280__)
29
+  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
30
+#endif
31
+
32
+#undef ALLOW_MEGA1280
33
+#undef ALLOW_MEGA2560

+ 3
- 3
Marlin/src/pins/sam/pins_ADSK.h 查看文件

@@ -27,9 +27,9 @@
27 27
 
28 28
 #define BOARD_INFO_NAME "ADSK"
29 29
 
30
-#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega1280__, __AVR_ATmega2560__)
31
-  #error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
32
-#endif
30
+#define ALLOW_MEGA1280
31
+#define ALLOW_MEGA2560
32
+#include "env_validate.h"
33 33
 
34 34
 /* CNC shield modifications:
35 35
 FROM THE BOTTOM CUT THE 5V PIN THAT GOES TO ARDUINO!!!

+ 1
- 3
Marlin/src/pins/sam/pins_ALLIGATOR_R2.h 查看文件

@@ -26,9 +26,7 @@
26 26
  * https://reprap.org/wiki/Alligator_Board
27 27
  */
28 28
 
29
-#if NOT_TARGET(__SAM3X8E__)
30
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
31
-#endif
29
+#include "env_validate.h"
32 30
 
33 31
 #define BOARD_INFO_NAME    "Alligator Board R2"
34 32
 

+ 1
- 3
Marlin/src/pins/sam/pins_CNCONTROLS_15D.h 查看文件

@@ -24,9 +24,7 @@
24 24
  * CNControls V15 for HMS434 with DUE pin assignments
25 25
  */
26 26
 
27
-#if NOT_TARGET(__SAM3X8E__)
28
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
29
-#endif
27
+#include "env_validate.h"
30 28
 
31 29
 #define BOARD_INFO_NAME "CN Controls V15D"
32 30
 

+ 1
- 3
Marlin/src/pins/sam/pins_DUE3DOM.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * DUE3DOM pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__SAM3X8E__)
29
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "DUE3DOM"
33 31
 

+ 1
- 3
Marlin/src/pins/sam/pins_DUE3DOM_MINI.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * DUE3DOM MINI pin assignments
26 26
  */
27 27
 
28
-#if NOT_TARGET(__SAM3X8E__)
29
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "DUE3DOM MINI"
33 31
 

+ 1
- 3
Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * PRINTRBOARD_G2
26 26
  */
27 27
 
28
-#if NOT_TARGET(__SAM3X8E__)
29
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #ifndef BOARD_INFO_NAME
33 31
   #define BOARD_INFO_NAME "Printrboard G2"

+ 1
- 3
Marlin/src/pins/sam/pins_RADDS.h 查看文件

@@ -25,9 +25,7 @@
25 25
  * RADDS
26 26
  */
27 27
 
28
-#if NOT_TARGET(__SAM3X8E__)
29
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
30
-#endif
28
+#include "env_validate.h"
31 29
 
32 30
 #define BOARD_INFO_NAME "RADDS"
33 31
 

+ 1
- 6
Marlin/src/pins/sam/pins_RAMPS4DUE.h 查看文件

@@ -39,14 +39,9 @@
39 39
  *       A15 | NC
40 40
  */
41 41
 
42
-#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
43
-  #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
44
-#endif
45
-
42
+#define ALLOW_SAM3X8E
46 43
 #define BOARD_INFO_NAME "RAMPS4DUE"
47 44
 
48
-#define IS_RAMPS4DUE
49
-
50 45
 //
51 46
 // Temperature Sensors
52 47
 //

+ 1
- 6
Marlin/src/pins/sam/pins_RAMPS_DUO.h 查看文件

@@ -43,14 +43,9 @@
43 43
  *       A15 | A11
44 44
  */
45 45
 
46
-#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
47
-  #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
48
-#endif
49
-
50 46
 #define BOARD_INFO_NAME "RAMPS Duo"
51 47
 
52
-#define IS_RAMPS_DUO
53
-
48
+#define ALLOW_SAM3X8E
54 49
 #include "../ramps/pins_RAMPS.h"
55 50
 
56 51
 //

+ 1
- 3
Marlin/src/pins/sam/pins_RAMPS_FD_V1.h 查看文件

@@ -28,9 +28,7 @@
28 28
  * Use 4k7 thermistor tables
29 29
  */
30 30
 
31
-#if NOT_TARGET(__SAM3X8E__)
32
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
33
-#endif
31
+#include "env_validate.h"
34 32
 
35 33
 #ifndef BOARD_INFO_NAME
36 34
   #define BOARD_INFO_NAME "RAMPS-FD v1"

+ 1
- 5
Marlin/src/pins/sam/pins_RAMPS_SMART.h 查看文件

@@ -60,12 +60,8 @@
60 60
  * (Search the web for "Arduino DUE Board Pinout" to see the correct header.)
61 61
  */
62 62
 
63
-#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
64
-  #error "Oops! Select 'Arduino Due' or 'Mega 2560' in 'Tools > Board.'"
65
-#endif
66
-
67 63
 #define BOARD_INFO_NAME "RAMPS-SMART"
68
-#define IS_RAMPS_SMART
64
+#define ALLOW_SAM3X8E
69 65
 #include "../ramps/pins_RAMPS.h"
70 66
 
71 67
 // I2C EEPROM with 4K of space

+ 1
- 3
Marlin/src/pins/sam/pins_RURAMPS4D_11.h 查看文件

@@ -32,9 +32,7 @@
32 32
  *           |
33 33
  */
34 34
 
35
-#if NOT_TARGET(__SAM3X8E__)
36
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
37
-#endif
35
+#include "env_validate.h"
38 36
 
39 37
 #define BOARD_INFO_NAME "RuRAMPS4Due v1.1"
40 38
 

+ 1
- 3
Marlin/src/pins/sam/pins_RURAMPS4D_13.h 查看文件

@@ -32,9 +32,7 @@
32 32
  *           |
33 33
  */
34 34
 
35
-#if NOT_TARGET(__SAM3X8E__)
36
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
37
-#endif
35
+#include "env_validate.h"
38 36
 
39 37
 #define BOARD_INFO_NAME "RuRAMPS4Due v1.3"
40 38
 

+ 1
- 3
Marlin/src/pins/sam/pins_ULTRATRONICS_PRO.h 查看文件

@@ -26,9 +26,7 @@
26 26
  * https://reprapworld.com/documentation/datasheet_ultratronics10_05.pdf
27 27
  */
28 28
 
29
-#if NOT_TARGET(ARDUINO_ARCH_SAM)
30
-  #error "Oops! Select 'Arduino Due' in 'Tools > Board.'"
31
-#endif
29
+#include "env_validate.h"
32 30
 
33 31
 #define BOARD_INFO_NAME "Ultratronics v1.0"
34 32
 

+ 42
- 0
Marlin/src/pins/sanguino/env_validate.h 查看文件

@@ -0,0 +1,42 @@
1
+  /**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#if ENABLED(ALLOW_MEGA644)
25
+  #if NOT_TARGET(__AVR_ATmega644__, __AVR_ATmega644P__, __AVR_ATmega1284P__)
26
+    #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'"
27
+  #endif
28
+#elif ENABLED(ALLOW_MEGA644P)
29
+  #if NOT_TARGET(__AVR_ATmega644P__, __AVR_ATmega1284P__)
30
+    #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'"
31
+  #endif
32
+#elif ENABLED(REQUIRE_MEGA644P)
33
+  #if NOT_TARGET(__AVR_ATmega644P__)
34
+    #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega644P' in 'Tools > Processor.'"
35
+  #endif
36
+#elif NOT_TARGET(__AVR_ATmega1284P__)
37
+  #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega1284P' in 'Tools > Processor.' (For PlatformIO, use 'melzi' or 'melzi_optiboot.')"
38
+#endif
39
+
40
+#undef ALLOW_MEGA644
41
+#undef ALLOW_MEGA644P
42
+#undef REQUIRE_MEGA644P

+ 2
- 3
Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h 查看文件

@@ -48,9 +48,8 @@
48 48
  * Once installed select the Sanguino board and then select the CPU.
49 49
  */
50 50
 
51
-#if NOT_TARGET(__AVR_ATmega644P__)
52
-  #error "Oops! Select 'Sanguino' in 'Tools > Board.'"
53
-#endif
51
+#define REQUIRE_MEGA644P
52
+#include "env_validate.h"
54 53
 
55 54
 #define BOARD_INFO_NAME "Gen3 Monolithic"
56 55
 #define DEBUG_PIN                              0

+ 0
- 0
Marlin/src/pins/sanguino/pins_GEN3_PLUS.h 查看文件


部分文件因文件數量過多而無法顯示

Loading…
取消
儲存