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
   #define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0)
93
   #define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0)
94
 #else
94
 #else
95
   #if !WITHIN(SERIAL_PORT, -1, 3)
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
   #endif
97
   #endif
98
   #define MYSERIAL1 customizedSerial1
98
   #define MYSERIAL1 customizedSerial1
99
 
99
 
100
   #ifdef SERIAL_PORT_2
100
   #ifdef SERIAL_PORT_2
101
     #if !WITHIN(SERIAL_PORT_2, -1, 3)
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
     #endif
103
     #endif
104
     #define MYSERIAL2 customizedSerial2
104
     #define MYSERIAL2 customizedSerial2
105
   #endif
105
   #endif
107
 
107
 
108
 #ifdef MMU2_SERIAL_PORT
108
 #ifdef MMU2_SERIAL_PORT
109
   #if !WITHIN(MMU2_SERIAL_PORT, -1, 3)
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
   #endif
111
   #endif
112
   #define MMU2_SERIAL mmuSerial
112
   #define MMU2_SERIAL mmuSerial
113
 #endif
113
 #endif
114
 
114
 
115
 #ifdef LCD_SERIAL_PORT
115
 #ifdef LCD_SERIAL_PORT
116
   #if !WITHIN(LCD_SERIAL_PORT, -1, 3)
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
   #endif
118
   #endif
119
   #define LCD_SERIAL lcdSerial
119
   #define LCD_SERIAL lcdSerial
120
   #if HAS_DGUS_LCD
120
   #if HAS_DGUS_LCD

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

56
 #elif WITHIN(SERIAL_PORT, 0, 3)
56
 #elif WITHIN(SERIAL_PORT, 0, 3)
57
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
57
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
58
 #else
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
 #endif
60
 #endif
61
 
61
 
62
 #ifdef SERIAL_PORT_2
62
 #ifdef SERIAL_PORT_2
65
   #elif WITHIN(SERIAL_PORT_2, 0, 3)
65
   #elif WITHIN(SERIAL_PORT_2, 0, 3)
66
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
66
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
67
   #else
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
   #endif
69
   #endif
70
 #endif
70
 #endif
71
 
71
 
73
   #if WITHIN(MMU2_SERIAL_PORT, 0, 3)
73
   #if WITHIN(MMU2_SERIAL_PORT, 0, 3)
74
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
74
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
75
   #else
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
   #endif
77
   #endif
78
 #endif
78
 #endif
79
 
79
 
83
   #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
83
   #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
84
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
84
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
85
   #else
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
   #endif
87
   #endif
88
 #endif
88
 #endif
89
 
89
 

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

71
 #elif WITHIN(SERIAL_PORT, 0, 3)
71
 #elif WITHIN(SERIAL_PORT, 0, 3)
72
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
72
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
73
 #else
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
 #endif
75
 #endif
76
 
76
 
77
 #ifdef SERIAL_PORT_2
77
 #ifdef SERIAL_PORT_2
80
   #elif WITHIN(SERIAL_PORT_2, 0, 3)
80
   #elif WITHIN(SERIAL_PORT_2, 0, 3)
81
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
81
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
82
   #else
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
   #endif
84
   #endif
85
 #endif
85
 #endif
86
 
86
 
90
   #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
90
   #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
91
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
91
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
92
   #else
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
   #endif
94
   #endif
95
 #endif
95
 #endif
96
 
96
 
100
   #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
100
   #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
101
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
101
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
102
   #else
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
   #endif
104
   #endif
105
   #if HAS_DGUS_LCD
105
   #if HAS_DGUS_LCD
106
     #define SERIAL_GET_TX_BUFFER_FREE() MSerial0.available()
106
     #define SERIAL_GET_TX_BUFFER_FREE() MSerial0.available()

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

54
   #elif WITHIN(SERIAL_PORT, 0, 3)
54
   #elif WITHIN(SERIAL_PORT, 0, 3)
55
     #define MYSERIAL1 MSERIAL(SERIAL_PORT)
55
     #define MYSERIAL1 MSERIAL(SERIAL_PORT)
56
   #else
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
   #endif
58
   #endif
59
 
59
 
60
   #ifdef SERIAL_PORT_2
60
   #ifdef SERIAL_PORT_2
63
     #elif WITHIN(SERIAL_PORT_2, 0, 3)
63
     #elif WITHIN(SERIAL_PORT_2, 0, 3)
64
       #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
64
       #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
65
     #else
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
     #endif
67
     #endif
68
   #endif
68
   #endif
69
 
69
 
73
     #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
73
     #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
74
       #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
74
       #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
75
     #else
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
     #endif
77
     #endif
78
   #endif
78
   #endif
79
 
79
 
83
     #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
83
     #elif WITHIN(LCD_SERIAL_PORT, 0, 3)
84
       #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
84
       #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
85
     #else
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
     #endif
87
     #endif
88
   #endif
88
   #endif
89
 
89
 

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

55
 #elif WITHIN(SERIAL_PORT, 1, 6)
55
 #elif WITHIN(SERIAL_PORT, 1, 6)
56
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
56
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
57
 #else
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
 #endif
59
 #endif
60
 
60
 
61
 #ifdef SERIAL_PORT_2
61
 #ifdef SERIAL_PORT_2
64
   #elif WITHIN(SERIAL_PORT_2, 1, 6)
64
   #elif WITHIN(SERIAL_PORT_2, 1, 6)
65
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
65
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
66
   #else
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
   #endif
68
   #endif
69
 #endif
69
 #endif
70
 
70
 
74
   #elif WITHIN(MMU2_SERIAL_PORT, 1, 6)
74
   #elif WITHIN(MMU2_SERIAL_PORT, 1, 6)
75
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
75
     #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
76
   #else
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
   #endif
78
   #endif
79
 #endif
79
 #endif
80
 
80
 
84
   #elif WITHIN(LCD_SERIAL_PORT, 1, 6)
84
   #elif WITHIN(LCD_SERIAL_PORT, 1, 6)
85
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
85
     #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
86
   #else
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
   #endif
88
   #endif
89
   #if HAS_DGUS_LCD
89
   #if HAS_DGUS_LCD
90
     #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
90
     #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()

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

87
 #else
87
 #else
88
   #define MYSERIAL1 MSERIAL(1) // dummy port
88
   #define MYSERIAL1 MSERIAL(1) // dummy port
89
   #if NUM_UARTS == 5
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
   #else
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
   #endif
93
   #endif
94
 #endif
94
 #endif
95
 
95
 
101
   #else
101
   #else
102
     #define MYSERIAL2 MSERIAL(1) // dummy port
102
     #define MYSERIAL2 MSERIAL(1) // dummy port
103
     #if NUM_UARTS == 5
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
     #else
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
     #endif
107
     #endif
108
   #endif
108
   #endif
109
 #endif
109
 #endif
116
   #else
116
   #else
117
     #define MMU2_SERIAL MSERIAL(1) // dummy port
117
     #define MMU2_SERIAL MSERIAL(1) // dummy port
118
     #if NUM_UARTS == 5
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
     #else
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
     #endif
122
     #endif
123
   #endif
123
   #endif
124
 #endif
124
 #endif
131
   #else
131
   #else
132
     #define LCD_SERIAL MSERIAL(1) // dummy port
132
     #define LCD_SERIAL MSERIAL(1) // dummy port
133
     #if NUM_UARTS == 5
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
     #else
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
     #endif
137
     #endif
138
   #endif
138
   #endif
139
   #if HAS_DGUS_LCD
139
   #if HAS_DGUS_LCD

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

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

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

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

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

74
   DECLARE_SERIAL(SERIAL_PORT);
74
   DECLARE_SERIAL(SERIAL_PORT);
75
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
75
   #define MYSERIAL1 MSERIAL(SERIAL_PORT)
76
 #else
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
 #endif
78
 #endif
79
 
79
 
80
 #ifdef SERIAL_PORT_2
80
 #ifdef SERIAL_PORT_2
85
   #elif WITHIN(SERIAL_PORT_2, 0, 8)
85
   #elif WITHIN(SERIAL_PORT_2, 0, 8)
86
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
86
     #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
87
   #else
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
   #endif
89
   #endif
90
 #endif
90
 #endif
91
 
91
 

Loading…
Cancel
Save