Skip to content

Commit 895e401

Browse files
committed
Suppress redundant serial errors
1 parent c442485 commit 895e401

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

Marlin/src/HAL/STM32F1/HAL.h

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,27 @@
8484
#define MYSERIAL1 UsbSerial
8585
#elif WITHIN(SERIAL_PORT, 1, NUM_UARTS)
8686
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
87-
#elif NUM_UARTS == 5
88-
#error "SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
8987
#else
90-
#error "SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
88+
#define MYSERIAL1 MSERIAL(1) // dummy port
89+
#if NUM_UARTS == 5
90+
#error "SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
91+
#else
92+
#error "SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
93+
#endif
9194
#endif
9295

9396
#ifdef SERIAL_PORT_2
9497
#if SERIAL_PORT_2 == -1
9598
#define MYSERIAL2 UsbSerial
9699
#elif WITHIN(SERIAL_PORT_2, 1, NUM_UARTS)
97100
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
98-
#elif NUM_UARTS == 5
99-
#error "SERIAL_PORT_2 must be -1 or from 1 to 5. Please update your configuration."
100101
#else
101-
#error "SERIAL_PORT_2 must be -1 or from 1 to 3. Please update your configuration."
102+
#define MYSERIAL2 MSERIAL(1) // dummy port
103+
#if NUM_UARTS == 5
104+
#error "SERIAL_PORT_2 must be -1 or from 1 to 5. Please update your configuration."
105+
#else
106+
#error "SERIAL_PORT_2 must be -1 or from 1 to 3. Please update your configuration."
107+
#endif
102108
#endif
103109
#endif
104110

@@ -107,10 +113,13 @@
107113
#define MMU2_SERIAL UsbSerial
108114
#elif WITHIN(MMU2_SERIAL_PORT, 1, NUM_UARTS)
109115
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
110-
#elif NUM_UARTS == 5
111-
#error "MMU2_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
112116
#else
113-
#error "MMU2_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
117+
#define MMU2_SERIAL MSERIAL(1) // dummy port
118+
#if NUM_UARTS == 5
119+
#error "MMU2_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
120+
#else
121+
#error "MMU2_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
122+
#endif
114123
#endif
115124
#endif
116125

@@ -119,10 +128,13 @@
119128
#define LCD_SERIAL UsbSerial
120129
#elif WITHIN(LCD_SERIAL_PORT, 1, NUM_UARTS)
121130
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
122-
#elif NUM_UARTS == 5
123-
#error "LCD_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
124131
#else
125-
#error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
132+
#define LCD_SERIAL MSERIAL(1) // dummy port
133+
#if NUM_UARTS == 5
134+
#error "LCD_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
135+
#else
136+
#error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
137+
#endif
126138
#endif
127139
#if HAS_DGUS_LCD
128140
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()

Marlin/src/lcd/extui/lib/dgus/mks/DGUSDisplayDef.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
733733

734734

735735
// SDCard File listing
736-
736+
737737
#if ENABLED(SDSUPPORT)
738738
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
739739
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
@@ -760,7 +760,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
760760
VPHELPER(VP_OFFSET_Y, &probe.offset.y, ScreenHandler.GetOffsetValue,ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>),
761761
VPHELPER(VP_OFFSET_Z, &probe.offset.z, ScreenHandler.GetOffsetValue,ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>),
762762
#endif
763-
#else
763+
#else
764764
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.PrintReturn, nullptr),
765765
#endif
766766

Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ class DGUSScreenHandler {
158158
static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr);
159159
#endif
160160

161-
162161
#if ENABLED(SDSUPPORT)
163162
// Callback for VP "Display wants to change screen when there is a SD card"
164163
static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr);
@@ -184,7 +183,7 @@ class DGUSScreenHandler {
184183
static void SDCardError();
185184
// Marlin informed us about SD print completion.
186185
static void SDPrintingFinished();
187-
#else
186+
#else
188187
static void PrintReturn(DGUS_VP_Variable &var, void *val_ptr);
189188
#endif
190189

buildroot/tests/BIGTREE_SKR_PRO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 SERIAL_PORT -1 \
2626
CUTTER_POWER_UNIT PERCENT \
2727
SPINDLE_LASER_PWM_PIN HEATER_1_PIN SPINDLE_LASER_ENA_PIN HEATER_2_PIN \
2828
TEMP_SENSOR_COOLER 1000 TEMP_COOLER_PIN PD13
29-
opt_enable LASER_FEATURE REPRAP_DISCOUNT_SMART_CONTROLLER
29+
opt_enable LASER_FEATURE REPRAP_DISCOUNT_SMART_CONTROLLER
3030
exec_test $1 $2 "BigTreeTech SKR Pro | Laser (Percent) | Cooling | LCD" "$3"
3131

3232
# clean up

0 commit comments

Comments
 (0)