Skip to content

Commit 37fff60

Browse files
authored
Merge pull request MarlinFirmware#8652 from fiveangle/bf2_usbcon_xonxoff
[2.0.x] SERIAL_XON_XOFF not supported on USB-native AVR devices
2 parents 02dd621 + 91b63f6 commit 37fff60

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Marlin/src/inc/Conditionals_adv.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,20 @@
2929
#define CONDITIONALS_ADV_H
3030

3131
#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, ...]
3535
#ifndef RX_BUFFER_SIZE
3636
#define RX_BUFFER_SIZE 128
3737
#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]
3940
#ifndef TX_BUFFER_SIZE
4041
#define TX_BUFFER_SIZE 32
4142
#endif
43+
#else
44+
// SERIAL_XON_XOFF not supported on USB-native devices
45+
#undef SERIAL_XON_XOFF
4246
#endif
4347

4448
#endif // CONDITIONALS_ADV_H

Marlin/src/inc/SanityCheck.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,18 @@
253253
*/
254254
#ifndef USBCON
255255
#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."
257257
#endif
258258

259259
#if !IS_POWER_OF_2(RX_BUFFER_SIZE) || RX_BUFFER_SIZE < 2
260260
#error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
261261
#endif
262262

263-
// 256 is the max limit due to uint8_t head and tail. Use only powers of 2. (...,16,32,64,128,256)
264263
#if TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
265264
#error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
266265
#endif
266+
#elif ENABLED(SERIAL_XON_XOFF)
267+
#error "SERIAL_XON_XOFF is not supported on USB-native AVR devices."
267268
#endif
268269

269270
/**

0 commit comments

Comments
 (0)