Suppress redundant serial errors

This commit is contained in:
Scott Lahteine 2021-03-18 22:49:04 -05:00
parent c442485137
commit 895e40190b
4 changed files with 28 additions and 17 deletions

View File

@ -84,46 +84,58 @@
#define MYSERIAL1 UsbSerial #define MYSERIAL1 UsbSerial
#elif WITHIN(SERIAL_PORT, 1, NUM_UARTS) #elif WITHIN(SERIAL_PORT, 1, NUM_UARTS)
#define MYSERIAL1 MSERIAL(SERIAL_PORT) #define MYSERIAL1 MSERIAL(SERIAL_PORT)
#elif NUM_UARTS == 5 #else
#define MYSERIAL1 MSERIAL(1) // dummy port
#if NUM_UARTS == 5
#error "SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration." #error "SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
#else #else
#error "SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." #error "SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
#endif #endif
#endif
#ifdef SERIAL_PORT_2 #ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == -1 #if SERIAL_PORT_2 == -1
#define MYSERIAL2 UsbSerial #define MYSERIAL2 UsbSerial
#elif WITHIN(SERIAL_PORT_2, 1, NUM_UARTS) #elif WITHIN(SERIAL_PORT_2, 1, NUM_UARTS)
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2) #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
#elif NUM_UARTS == 5 #else
#define MYSERIAL2 MSERIAL(1) // dummy port
#if NUM_UARTS == 5
#error "SERIAL_PORT_2 must be -1 or from 1 to 5. Please update your configuration." #error "SERIAL_PORT_2 must be -1 or from 1 to 5. Please update your configuration."
#else #else
#error "SERIAL_PORT_2 must be -1 or from 1 to 3. Please update your configuration." #error "SERIAL_PORT_2 must be -1 or from 1 to 3. Please update your configuration."
#endif #endif
#endif #endif
#endif
#ifdef MMU2_SERIAL_PORT #ifdef MMU2_SERIAL_PORT
#if MMU2_SERIAL_PORT == -1 #if MMU2_SERIAL_PORT == -1
#define MMU2_SERIAL UsbSerial #define MMU2_SERIAL UsbSerial
#elif WITHIN(MMU2_SERIAL_PORT, 1, NUM_UARTS) #elif WITHIN(MMU2_SERIAL_PORT, 1, NUM_UARTS)
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT) #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
#elif NUM_UARTS == 5 #else
#define MMU2_SERIAL MSERIAL(1) // dummy port
#if NUM_UARTS == 5
#error "MMU2_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration." #error "MMU2_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
#else #else
#error "MMU2_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." #error "MMU2_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
#endif #endif
#endif #endif
#endif
#ifdef LCD_SERIAL_PORT #ifdef LCD_SERIAL_PORT
#if LCD_SERIAL_PORT == -1 #if LCD_SERIAL_PORT == -1
#define LCD_SERIAL UsbSerial #define LCD_SERIAL UsbSerial
#elif WITHIN(LCD_SERIAL_PORT, 1, NUM_UARTS) #elif WITHIN(LCD_SERIAL_PORT, 1, NUM_UARTS)
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT) #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
#elif NUM_UARTS == 5 #else
#define LCD_SERIAL MSERIAL(1) // dummy port
#if NUM_UARTS == 5
#error "LCD_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration." #error "LCD_SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration."
#else #else
#error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration." #error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
#endif #endif
#endif
#if HAS_DGUS_LCD #if HAS_DGUS_LCD
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif #endif

View File

@ -158,7 +158,6 @@ public:
static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr); static void GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr);
#endif #endif
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
// Callback for VP "Display wants to change screen when there is a SD card" // Callback for VP "Display wants to change screen when there is a SD card"
static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr); static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr);