Explorar el Código

Merge pull request #8652 from fiveangle/bf2_usbcon_xonxoff

[2.0.x] SERIAL_XON_XOFF not supported on USB-native AVR devices
Scott Lahteine hace 7 años
padre
commit
37fff608b0
No account linked to committer's email address
Se han modificado 2 ficheros con 11 adiciones y 6 borrados
  1. 8
    4
      Marlin/src/inc/Conditionals_adv.h
  2. 3
    2
      Marlin/src/inc/SanityCheck.h

+ 8
- 4
Marlin/src/inc/Conditionals_adv.h Ver fichero

@@ -29,16 +29,20 @@
29 29
 #define CONDITIONALS_ADV_H
30 30
 
31 31
   #ifndef USBCON
32
-    // Define constants and variables for buffering incoming serial data.
33
-    // Use only powers of 2.
34
-    // : [0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
32
+    // Define constants and variables for buffering serial data.
33
+    // Use only 0 or powers of 2 greater than 1
34
+    // : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
35 35
     #ifndef RX_BUFFER_SIZE
36 36
       #define RX_BUFFER_SIZE 128
37 37
     #endif
38
-    // 256 is the max TX buffer climit due to uint8_t head and tail.
38
+    // 256 is the max TX buffer limit due to uint8_t head and tail
39
+    // : [0, 4, 8, 16, 32, 64, 128, 256]
39 40
     #ifndef TX_BUFFER_SIZE
40 41
       #define TX_BUFFER_SIZE 32
41 42
     #endif
43
+  #else
44
+    // SERIAL_XON_XOFF not supported on USB-native devices
45
+    #undef SERIAL_XON_XOFF
42 46
   #endif
43 47
 
44 48
 #endif // CONDITIONALS_ADV_H

+ 3
- 2
Marlin/src/inc/SanityCheck.h Ver fichero

@@ -253,17 +253,18 @@
253 253
  */
254 254
 #ifndef USBCON
255 255
   #if ENABLED(SERIAL_XON_XOFF) && RX_BUFFER_SIZE < 1024
256
-    #error "XON/XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
256
+    #error "SERIAL_XON_XOFF requires RX_BUFFER_SIZE >= 1024 for reliable transfers without drops."
257 257
   #endif
258 258
 
259 259
   #if !IS_POWER_OF_2(RX_BUFFER_SIZE) || RX_BUFFER_SIZE < 2
260 260
     #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
261 261
   #endif
262 262
 
263
-  // 256 is the max limit due to uint8_t head and tail. Use only powers of 2. (...,16,32,64,128,256)
264 263
   #if TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
265 264
     #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
266 265
   #endif
266
+#elif ENABLED(SERIAL_XON_XOFF)
267
+  #error "SERIAL_XON_XOFF is not supported on USB-native AVR devices."
267 268
 #endif
268 269
 
269 270
 /**

Loading…
Cancelar
Guardar