Browse Source

MarlinSerial cleanup

Scott Lahteine 4 years ago
parent
commit
604c5dedf4
1 changed files with 11 additions and 22 deletions
  1. 11
    22
      Marlin/src/HAL/AVR/MarlinSerial.h

+ 11
- 22
Marlin/src/HAL/AVR/MarlinSerial.h View File

@@ -252,13 +252,13 @@
252 252
   template <uint8_t serial>
253 253
   struct MMU2SerialCfg {
254 254
     static constexpr int PORT               = serial;
255
+    static constexpr unsigned int RX_SIZE   = 32;
256
+    static constexpr unsigned int TX_SIZE   = 32;
255 257
     static constexpr bool XONOFF            = false;
256 258
     static constexpr bool EMERGENCYPARSER   = false;
257 259
     static constexpr bool DROPPED_RX        = false;
258 260
     static constexpr bool RX_FRAMING_ERRORS = false;
259 261
     static constexpr bool MAX_RX_QUEUED     = false;
260
-    static constexpr unsigned int RX_SIZE   = 32;
261
-    static constexpr unsigned int TX_SIZE   = 32;
262 262
     static constexpr bool RX_OVERRUNS       = false;
263 263
   };
264 264
 
@@ -270,28 +270,17 @@
270 270
 
271 271
   template <uint8_t serial>
272 272
   struct LCDSerialCfg {
273
-    static constexpr int PORT                 = serial;
274
-    static constexpr bool XONOFF              = false;
275
-    static constexpr bool EMERGENCYPARSER     = ENABLED(EMERGENCY_PARSER);
276
-    static constexpr bool DROPPED_RX          = false;
277
-    static constexpr bool RX_FRAMING_ERRORS   = false;
278
-    static constexpr bool MAX_RX_QUEUED       = false;
279
-    #if HAS_DGUS_LCD
280
-      static constexpr unsigned int RX_SIZE   = DGUS_RX_BUFFER_SIZE;
281
-      static constexpr unsigned int TX_SIZE   = DGUS_TX_BUFFER_SIZE;
282
-      static constexpr bool RX_OVERRUNS       = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
283
-    #elif EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
284
-      static constexpr unsigned int RX_SIZE   = 64;
285
-      static constexpr unsigned int TX_SIZE   = 128;
286
-      static constexpr bool RX_OVERRUNS       = false;
287
-    #else
288
-      static constexpr unsigned int RX_SIZE   = 64;
289
-      static constexpr unsigned int TX_SIZE   = 128;
290
-      static constexpr bool RX_OVERRUNS       = false;
291
-    #endif
273
+    static constexpr int PORT               = serial;
274
+    static constexpr unsigned int RX_SIZE   = TERN(HAS_DGUS_LCD, DGUS_RX_BUFFER_SIZE,  64);
275
+    static constexpr unsigned int TX_SIZE   = TERN(HAS_DGUS_LCD, DGUS_TX_BUFFER_SIZE, 128);
276
+    static constexpr bool XONOFF            = false;
277
+    static constexpr bool EMERGENCYPARSER   = ENABLED(EMERGENCY_PARSER);
278
+    static constexpr bool DROPPED_RX        = false;
279
+    static constexpr bool RX_FRAMING_ERRORS = false;
280
+    static constexpr bool MAX_RX_QUEUED     = false;
281
+    static constexpr bool RX_OVERRUNS       = BOTH(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
292 282
   };
293 283
 
294
-
295 284
   typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialT4;
296 285
   extern MSerialT4 lcdSerial;
297 286
 #endif

Loading…
Cancel
Save