Skip to content

Commit

Permalink
Sanity check old serial names
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and vgadreau committed Dec 9, 2020
1 parent eb3022e commit 35040ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@

#define DGUS_RX_BUFFER_SIZE 128
#define DGUS_TX_BUFFER_SIZE 48
//#define DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS // Fix Rx overrun situation (Currently only for AVR)
//#define SERIAL_STATS_RX_BUFFER_OVERRUNS // Fix Rx overrun situation (Currently only for AVR)

#define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
#if HAS_DGUS_LCD
static constexpr unsigned int RX_SIZE = DGUS_RX_BUFFER_SIZE;
static constexpr unsigned int TX_SIZE = DGUS_TX_BUFFER_SIZE;
static constexpr bool RX_OVERRUNS = ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS);
static constexpr bool RX_OVERRUNS = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
#elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
static constexpr unsigned int RX_SIZE = 64;
static constexpr unsigned int TX_SIZE = 128;
Expand Down
8 changes: 8 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,14 @@
#error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration."
#elif defined(DGUS_BAUDRATE)
#error "DGUS_BAUDRATE is now LCD_BAUDRATE. Please update your configuration."
#elif defined(DGUS_STATS_RX_BUFFER_OVERRUNS)
#error "DGUS_STATS_RX_BUFFER_OVERRUNS is now STATS_RX_BUFFER_OVERRUNS. Please update your configuration."
#elif defined(DGUS_SERIAL_PORT)
#error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration."
#elif defined(ANYCUBIC_LCD_SERIAL_PORT)
#error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT. Please update your configuration."
#elif defined(INTERNAL_SERIAL_PORT)
#error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT. Please update your configuration."
#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT)
#error "X_DUAL_ENDSTOPS_ADJUSTMENT is now X2_ENDSTOP_ADJUSTMENT. Please update Configuration_adv.h."
#elif defined(Y_DUAL_ENDSTOPS_ADJUSTMENT)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t val

void DGUSDisplay::ProcessRx() {

#if ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS)
#if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS)
if (!LCD_SERIAL.available() && LCD_SERIAL.buffer_overruns()) {
// Overrun, but reset the flag only when the buffer is empty
// We want to extract as many as valid datagrams possible...
Expand Down

0 comments on commit 35040ef

Please sign in to comment.