Browse Source

More detailed serial config error

Scott Lahteine 4 years ago
parent
commit
550a806d77

+ 4
- 4
Marlin/src/HAL/AVR/HAL.h View File

@@ -93,13 +93,13 @@ typedef int8_t pin_t;
93 93
   #define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0)
94 94
 #else
95 95
   #if !WITHIN(SERIAL_PORT, -1, 3)
96
-    #error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
96
+    #error "SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
97 97
   #endif
98 98
   #define MYSERIAL1 customizedSerial1
99 99
 
100 100
   #ifdef SERIAL_PORT_2
101 101
     #if !WITHIN(SERIAL_PORT_2, -1, 3)
102
-      #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
102
+      #error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
103 103
     #endif
104 104
     #define MYSERIAL2 customizedSerial2
105 105
   #endif
@@ -107,14 +107,14 @@ typedef int8_t pin_t;
107 107
 
108 108
 #ifdef MMU2_SERIAL_PORT
109 109
   #if !WITHIN(MMU2_SERIAL_PORT, -1, 3)
110
-    #error "MMU2_SERIAL_PORT must be from -1 to 3. Please update your configuration."
110
+    #error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
111 111
   #endif
112 112
   #define MMU2_SERIAL mmuSerial
113 113
 #endif
114 114
 
115 115
 #ifdef LCD_SERIAL_PORT
116 116
   #if !WITHIN(LCD_SERIAL_PORT, -1, 3)
117
-    #error "LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration."
117
+    #error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
118 118
   #endif
119 119
   #define LCD_SERIAL lcdSerial
120 120
   #if HAS_DGUS_LCD

+ 4
- 4
Marlin/src/HAL/DUE/HAL.h View File

@@ -56,7 +56,7 @@ extern DefaultSerial4 MSerial3;
56 56
 #elif WITHIN(SERIAL_PORT, 0, 3)
57 57
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
58 58
 #else
59
-  #error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration."
59
+  #error "The required SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
60 60
 #endif
61 61
 
62 62
 #ifdef SERIAL_PORT_2
@@ -65,7 +65,7 @@ extern DefaultSerial4 MSerial3;
65 65
   #elif WITHIN(SERIAL_PORT_2, 0, 3)
66 66
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
67 67
   #else
68
-    #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
68
+    #error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
69 69
   #endif
70 70
 #endif
71 71
 
@@ -73,7 +73,7 @@ extern DefaultSerial4 MSerial3;
73 73
   #if WITHIN(MMU2_SERIAL_PORT, 0, 3)
74 74
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
75 75
   #else
76
-    #error "MMU2_SERIAL_PORT must be from 0 to 3. Please update your configuration."
76
+    #error "MMU2_SERIAL_PORT must be from 0 to 3."
77 77
   #endif
78 78
 #endif
79 79
 
@@ -83,7 +83,7 @@ extern DefaultSerial4 MSerial3;
83 83
   #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
84 84
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
85 85
   #else
86
-    #error "LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration."
86
+    #error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
87 87
   #endif
88 88
 #endif
89 89
 

+ 4
- 4
Marlin/src/HAL/LPC1768/HAL.h View File

@@ -71,7 +71,7 @@ extern DefaultSerial1 USBSerial;
71 71
 #elif WITHIN(SERIAL_PORT, 0, 3)
72 72
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
73 73
 #else
74
-  #error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
74
+  #error "SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
75 75
 #endif
76 76
 
77 77
 #ifdef SERIAL_PORT_2
@@ -80,7 +80,7 @@ extern DefaultSerial1 USBSerial;
80 80
   #elif WITHIN(SERIAL_PORT_2, 0, 3)
81 81
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
82 82
   #else
83
-    #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
83
+    #error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
84 84
   #endif
85 85
 #endif
86 86
 
@@ -90,7 +90,7 @@ extern DefaultSerial1 USBSerial;
90 90
   #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
91 91
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
92 92
   #else
93
-    #error "MMU2_SERIAL_PORT must be from -1 to 3. Please update your configuration."
93
+    #error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
94 94
   #endif
95 95
 #endif
96 96
 
@@ -100,7 +100,7 @@ extern DefaultSerial1 USBSerial;
100 100
   #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
101 101
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
102 102
   #else
103
-    #error "LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration."
103
+    #error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
104 104
   #endif
105 105
   #if HAS_DGUS_LCD
106 106
     #define SERIAL_GET_TX_BUFFER_FREE() MSerial0.available()

+ 4
- 4
Marlin/src/HAL/SAMD51/HAL.h View File

@@ -54,7 +54,7 @@
54 54
   #elif WITHIN(SERIAL_PORT, 0, 3)
55 55
     #define MYSERIAL1 MSERIAL(SERIAL_PORT)
56 56
   #else
57
-    #error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
57
+    #error "SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
58 58
   #endif
59 59
 
60 60
   #ifdef SERIAL_PORT_2
@@ -63,7 +63,7 @@
63 63
     #elif WITHIN(SERIAL_PORT_2, 0, 3)
64 64
       #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
65 65
     #else
66
-      #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
66
+      #error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
67 67
     #endif
68 68
   #endif
69 69
 
@@ -73,7 +73,7 @@
73 73
     #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
74 74
       #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
75 75
     #else
76
-      #error "MMU2_SERIAL_PORT must be from -1 to 3. Please update your configuration."
76
+      #error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
77 77
     #endif
78 78
   #endif
79 79
 
@@ -83,7 +83,7 @@
83 83
     #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
84 84
       #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
85 85
     #else
86
-      #error "LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration."
86
+      #error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
87 87
     #endif
88 88
   #endif
89 89
 

+ 4
- 4
Marlin/src/HAL/STM32/HAL.h View File

@@ -55,7 +55,7 @@
55 55
 #elif WITHIN(SERIAL_PORT, 1, 6)
56 56
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
57 57
 #else
58
-  #error "SERIAL_PORT must be -1 or from 1 to 6. Please update your configuration."
58
+  #error "SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB."
59 59
 #endif
60 60
 
61 61
 #ifdef SERIAL_PORT_2
@@ -64,7 +64,7 @@
64 64
   #elif WITHIN(SERIAL_PORT_2, 1, 6)
65 65
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
66 66
   #else
67
-    #error "SERIAL_PORT_2 must be -1 or from 1 to 6. Please update your configuration."
67
+    #error "SERIAL_PORT_2 must be from 1 to 6. You can also use -1 if the board supports Native USB."
68 68
   #endif
69 69
 #endif
70 70
 
@@ -74,7 +74,7 @@
74 74
   #elif WITHIN(MMU2_SERIAL_PORT, 1, 6)
75 75
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
76 76
   #else
77
-    #error "MMU2_SERIAL_PORT must be -1 or from 1 to 6. Please update your configuration."
77
+    #error "MMU2_SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB."
78 78
   #endif
79 79
 #endif
80 80
 
@@ -84,7 +84,7 @@
84 84
   #elif WITHIN(LCD_SERIAL_PORT, 1, 6)
85 85
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
86 86
   #else
87
-    #error "LCD_SERIAL_PORT must be -1 or from 1 to 6. Please update your configuration."
87
+    #error "LCD_SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB."
88 88
   #endif
89 89
   #if HAS_DGUS_LCD
90 90
     #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()

+ 8
- 8
Marlin/src/HAL/STM32F1/HAL.h View File

@@ -87,9 +87,9 @@
87 87
 #else
88 88
   #define MYSERIAL1 MSERIAL(1) // dummy port
89 89
   #if NUM_UARTS == 5
90
-    #error "SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
90
+    #error "SERIAL_PORT must be from 1 to 5. You can also use -1 if the board supports Native USB."
91 91
   #else
92
-    #error "SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
92
+    #error "SERIAL_PORT must be from 1 to 3. You can also use -1 if the board supports Native USB."
93 93
   #endif
94 94
 #endif
95 95
 
@@ -101,9 +101,9 @@
101 101
   #else
102 102
     #define MYSERIAL2 MSERIAL(1) // dummy port
103 103
     #if NUM_UARTS == 5
104
-      #error "SERIAL_PORT_2 must be -1 or from 1 to 5. Please update your configuration."
104
+      #error "SERIAL_PORT_2 must be from 1 to 5. You can also use -1 if the board supports Native USB."
105 105
     #else
106
-      #error "SERIAL_PORT_2 must be -1 or from 1 to 3. Please update your configuration."
106
+      #error "SERIAL_PORT_2 must be from 1 to 3. You can also use -1 if the board supports Native USB."
107 107
     #endif
108 108
   #endif
109 109
 #endif
@@ -116,9 +116,9 @@
116 116
   #else
117 117
     #define MMU2_SERIAL MSERIAL(1) // dummy port
118 118
     #if NUM_UARTS == 5
119
-      #error "MMU2_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
119
+      #error "MMU2_SERIAL_PORT must be from 1 to 5. You can also use -1 if the board supports Native USB."
120 120
     #else
121
-      #error "MMU2_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
121
+      #error "MMU2_SERIAL_PORT must be from 1 to 3. You can also use -1 if the board supports Native USB."
122 122
     #endif
123 123
   #endif
124 124
 #endif
@@ -131,9 +131,9 @@
131 131
   #else
132 132
     #define LCD_SERIAL MSERIAL(1) // dummy port
133 133
     #if NUM_UARTS == 5
134
-      #error "LCD_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
134
+      #error "LCD_SERIAL_PORT must be from 1 to 5. You can also use -1 if the board supports Native USB."
135 135
     #else
136
-      #error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
136
+      #error "LCD_SERIAL_PORT must be from 1 to 3. You can also use -1 if the board supports Native USB."
137 137
     #endif
138 138
   #endif
139 139
   #if HAS_DGUS_LCD

+ 2
- 0
Marlin/src/HAL/TEENSY31_32/HAL.cpp View File

@@ -35,6 +35,8 @@
35 35
 #define IMPLEMENT_SERIAL(X)  _IMPLEMENT_SERIAL(X)
36 36
 #if WITHIN(SERIAL_PORT, 0, 3)
37 37
   IMPLEMENT_SERIAL(SERIAL_PORT);
38
+#else
39
+  #error "SERIAL_PORT must be from 0 to 3."
38 40
 #endif
39 41
 USBSerialType USBSerial(false, SerialUSB);
40 42
 

+ 2
- 0
Marlin/src/HAL/TEENSY35_36/HAL.h View File

@@ -72,6 +72,8 @@ extern USBSerialType USBSerial;
72 72
 #elif WITHIN(SERIAL_PORT, 0, 3)
73 73
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
74 74
   DECLARE_SERIAL(SERIAL_PORT);
75
+#else
76
+  #error "SERIAL_PORT must be from 0 to 3, or -1 for Native USB."
75 77
 #endif
76 78
 
77 79
 #define HAL_SERVO_LIB libServo

+ 2
- 2
Marlin/src/HAL/TEENSY40_41/HAL.h View File

@@ -74,7 +74,7 @@ extern USBSerialType USBSerial;
74 74
   DECLARE_SERIAL(SERIAL_PORT);
75 75
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
76 76
 #else
77
-  #error "The required SERIAL_PORT must be from -1 to 8. Please update your configuration."
77
+  #error "The required SERIAL_PORT must be from 0 to 8, or -1 for Native USB."
78 78
 #endif
79 79
 
80 80
 #ifdef SERIAL_PORT_2
@@ -85,7 +85,7 @@ extern USBSerialType USBSerial;
85 85
   #elif WITHIN(SERIAL_PORT_2, 0, 8)
86 86
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
87 87
   #else
88
-    #error "SERIAL_PORT_2 must be from -2 to 8. Please update your configuration."
88
+    #error "SERIAL_PORT_2 must be from 0 to 8, or -1 for Native USB, or -2 for Ethernet."
89 89
   #endif
90 90
 #endif
91 91
 

Loading…
Cancel
Save