Procházet zdrojové kódy

Add TX-buffer for MarlinSerial

Similar to the current Arduino HardwareSerial
but with max. 256 byte buffer-size.

Deactivated by default.

The boards with AT90USB processor (USBCON) already use a TX-buffer.
AnHardt před 8 roky
rodič
revize
4b44a23a36

+ 6
- 0
Marlin/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 140
- 8
Marlin/MarlinSerial.cpp Zobrazit soubor

@@ -21,11 +21,12 @@
21 21
  */
22 22
 
23 23
 /**
24
-  HardwareSerial.cpp - Hardware serial library for Wiring
24
+  MarlinSerial.cpp - Hardware serial library for Wiring
25 25
   Copyright (c) 2006 Nicholas Zambetti.  All right reserved.
26 26
 
27 27
   Modified 23 November 2006 by David A. Mellis
28 28
   Modified 28 September 2010 by Mark Sproul
29
+  Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
29 30
 */
30 31
 
31 32
 #include "Marlin.h"
@@ -38,9 +39,14 @@
38 39
 #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
39 40
 
40 41
 #if UART_PRESENT(SERIAL_PORT)
41
-  ring_buffer rx_buffer  =  { { 0 }, 0, 0 };
42
+  ring_buffer_r rx_buffer  =  { { 0 }, 0, 0 };
43
+  #if TX_BUFFER_SIZE > 0
44
+    ring_buffer_t tx_buffer  =  { { 0 }, 0, 0 };
45
+    static bool _written;
46
+  #endif
42 47
 #endif
43 48
 
49
+
44 50
 FORCE_INLINE void store_char(unsigned char c) {
45 51
   CRITICAL_SECTION_START;
46 52
     uint8_t h = rx_buffer.head;
@@ -61,12 +67,38 @@ FORCE_INLINE void store_char(unsigned char c) {
61 67
   #endif
62 68
 }
63 69
 
70
+#if TX_BUFFER_SIZE > 0
71
+  FORCE_INLINE void _tx_udr_empty_irq(void)
72
+  {
73
+    // If interrupts are enabled, there must be more data in the output
74
+    // buffer. Send the next byte
75
+    uint8_t t = tx_buffer.tail;
76
+    uint8_t c = tx_buffer.buffer[t];
77
+    tx_buffer.tail = (t + 1) & (TX_BUFFER_SIZE - 1);
78
+
79
+    M_UDRx = c;
80
+
81
+    // clear the TXC bit -- "can be cleared by writing a one to its bit
82
+    // location". This makes sure flush() won't return until the bytes
83
+    // actually got written
84
+    SBI(M_UCSRxA, M_TXCx);
85
+
86
+    if (tx_buffer.head == tx_buffer.tail) {
87
+      // Buffer empty, so disable interrupts
88
+      CBI(M_UCSRxB, M_UDRIEx);
89
+    }
90
+  }
91
+
92
+  #if defined(M_USARTx_UDRE_vect)
93
+    ISR(M_USARTx_UDRE_vect) {
94
+      _tx_udr_empty_irq();
95
+    }
96
+  #endif
97
+
98
+#endif
64 99
 
65
-//#elif defined(SIG_USART_RECV)
66 100
 #if defined(M_USARTx_RX_vect)
67
-  // fixed by Mark Sproul this is on the 644/644p
68
-  //SIGNAL(SIG_USART_RECV)
69
-  SIGNAL(M_USARTx_RX_vect) {
101
+  ISR(M_USARTx_RX_vect) {
70 102
     unsigned char c  =  M_UDRx;
71 103
     store_char(c);
72 104
   }
@@ -107,14 +139,25 @@ void MarlinSerial::begin(long baud) {
107 139
   SBI(M_UCSRxB, M_RXENx);
108 140
   SBI(M_UCSRxB, M_TXENx);
109 141
   SBI(M_UCSRxB, M_RXCIEx);
142
+  #if TX_BUFFER_SIZE > 0
143
+    CBI(M_UCSRxB, M_UDRIEx);
144
+    _written = false;
145
+  #endif
110 146
 }
111 147
 
112 148
 void MarlinSerial::end() {
113 149
   CBI(M_UCSRxB, M_RXENx);
114 150
   CBI(M_UCSRxB, M_TXENx);
115 151
   CBI(M_UCSRxB, M_RXCIEx);
152
+  CBI(M_UCSRxB, M_UDRIEx);
116 153
 }
117 154
 
155
+void MarlinSerial::checkRx(void) {
156
+  if (TEST(M_UCSRxA, M_RXCx)) {
157
+    uint8_t c  =  M_UDRx;
158
+    store_char(c);
159
+  }
160
+}
118 161
 
119 162
 int MarlinSerial::peek(void) {
120 163
   int v;
@@ -145,7 +188,16 @@ int MarlinSerial::read(void) {
145 188
   return v;
146 189
 }
147 190
 
148
-void MarlinSerial::flush() {
191
+uint8_t MarlinSerial::available(void) {
192
+  CRITICAL_SECTION_START;
193
+    uint8_t h = rx_buffer.head;
194
+    uint8_t t = rx_buffer.tail;
195
+  CRITICAL_SECTION_END;
196
+  return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
197
+}
198
+
199
+void MarlinSerial::flush(void) {
200
+  // RX
149 201
   // don't reverse this or there may be problems if the RX interrupt
150 202
   // occurs after reading the value of rx_buffer_head but before writing
151 203
   // the value to rx_buffer_tail; the previous value of rx_buffer_head
@@ -156,6 +208,86 @@ void MarlinSerial::flush() {
156 208
   CRITICAL_SECTION_END;
157 209
 }
158 210
 
211
+#if TX_BUFFER_SIZE > 0
212
+  uint8_t MarlinSerial::availableForWrite(void) {
213
+    CRITICAL_SECTION_START;
214
+      uint8_t h = tx_buffer.head;
215
+      uint8_t t = tx_buffer.tail;
216
+    CRITICAL_SECTION_END;
217
+    return (uint8_t)(TX_BUFFER_SIZE + h - t) & (TX_BUFFER_SIZE - 1);
218
+  }
219
+
220
+  void MarlinSerial::write(uint8_t c) {
221
+    _written = true;
222
+    CRITICAL_SECTION_START;
223
+      bool emty = (tx_buffer.head == tx_buffer.tail);
224
+    CRITICAL_SECTION_END;
225
+    // If the buffer and the data register is empty, just write the byte
226
+    // to the data register and be done. This shortcut helps
227
+    // significantly improve the effective datarate at high (>
228
+    // 500kbit/s) bitrates, where interrupt overhead becomes a slowdown.
229
+    if (emty && TEST(M_UCSRxA, M_UDREx)) {
230
+      CRITICAL_SECTION_START;
231
+        M_UDRx = c;
232
+        SBI(M_UCSRxA, M_TXCx);
233
+      CRITICAL_SECTION_END;
234
+      return;
235
+    }
236
+    uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1);
237
+
238
+    // If the output buffer is full, there's nothing for it other than to
239
+    // wait for the interrupt handler to empty it a bit
240
+    while (i == tx_buffer.tail) {
241
+      if (!TEST(SREG, SREG_I)) {
242
+        // Interrupts are disabled, so we'll have to poll the data
243
+        // register empty flag ourselves. If it is set, pretend an
244
+        // interrupt has happened and call the handler to free up
245
+        // space for us.
246
+        if(TEST(M_UCSRxA, M_UDREx))
247
+       _tx_udr_empty_irq();
248
+      } else {
249
+        // nop, the interrupt handler will free up space for us
250
+      }
251
+    }
252
+
253
+    tx_buffer.buffer[tx_buffer.head] = c;
254
+    { CRITICAL_SECTION_START;
255
+        tx_buffer.head = i;
256
+        SBI(M_UCSRxB, M_UDRIEx);
257
+      CRITICAL_SECTION_END;
258
+    }
259
+    return;
260
+  }
261
+
262
+  void MarlinSerial::flushTX(void) {
263
+    // TX
264
+    // If we have never written a byte, no need to flush. This special
265
+    // case is needed since there is no way to force the TXC (transmit
266
+    // complete) bit to 1 during initialization
267
+    if (!_written)
268
+      return;
269
+
270
+    while (TEST(M_UCSRxB, M_UDRIEx) || !TEST(M_UCSRxA, M_TXCx)) {
271
+      if (!TEST(SREG, SREG_I) && TEST(M_UCSRxB, M_UDRIEx))
272
+        // Interrupts are globally disabled, but the DR empty
273
+        // interrupt should be enabled, so poll the DR empty flag to
274
+        // prevent deadlock
275
+        if (TEST(M_UCSRxA, M_UDREx))
276
+          _tx_udr_empty_irq();
277
+    }
278
+    // If we get here, nothing is queued anymore (DRIE is disabled) and
279
+    // the hardware finished tranmission (TXC is set).
280
+}
281
+
282
+#else
283
+  void MarlinSerial::write(uint8_t c) {
284
+    while (!TEST(M_UCSRxA, M_UDREx))
285
+      ;
286
+    M_UDRx = c;
287
+  }
288
+#endif
289
+
290
+// end NEW
159 291
 
160 292
 /// imports from print.h
161 293
 
@@ -321,7 +453,7 @@ MarlinSerial customizedSerial;
321 453
   // Currently looking for: M108, M112, M410
322 454
   // If you alter the parser please don't forget to update the capabilities in Conditionals.h
323 455
 
324
-  void emergency_parser(unsigned char c) {
456
+  FORCE_INLINE void emergency_parser(unsigned char c) {
325 457
 
326 458
     enum e_parser_state {
327 459
       state_RESET,

+ 32
- 40
Marlin/MarlinSerial.h Zobrazit soubor

@@ -21,10 +21,12 @@
21 21
  */
22 22
 
23 23
 /**
24
-  HardwareSerial.h - Hardware serial library for Wiring
24
+  MarlinSerial.h - Hardware serial library for Wiring
25 25
   Copyright (c) 2006 Nicholas Zambetti.  All right reserved.
26 26
 
27 27
   Modified 28 September 2010 by Mark Sproul
28
+  Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
29
+
28 30
 */
29 31
 
30 32
 #ifndef MarlinSerial_h
@@ -61,14 +63,17 @@
61 63
 #define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,B)
62 64
 #define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,)
63 65
 #define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,)
66
+#define M_TXCx SERIAL_REGNAME(TXC,SERIAL_PORT,)
64 67
 #define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,)
65 68
 #define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,)
69
+#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,)
66 70
 #define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
67 71
 #define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H)
68 72
 #define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L)
69 73
 #define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,)
70 74
 #define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect)
71 75
 #define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,)
76
+#define M_USARTx_UDRE_vect SERIAL_REGNAME(USART,SERIAL_PORT,_UDRE_vect)
72 77
 
73 78
 
74 79
 #define DEC 10
@@ -87,18 +92,35 @@
87 92
 #ifndef RX_BUFFER_SIZE
88 93
   #define RX_BUFFER_SIZE 128
89 94
 #endif
95
+#ifndef TX_BUFFER_SIZE
96
+  #define TX_BUFFER_SIZE 32
97
+#endif
90 98
 #if !((RX_BUFFER_SIZE == 256) ||(RX_BUFFER_SIZE == 128) ||(RX_BUFFER_SIZE == 64) ||(RX_BUFFER_SIZE == 32) ||(RX_BUFFER_SIZE == 16) ||(RX_BUFFER_SIZE == 8) ||(RX_BUFFER_SIZE == 4) ||(RX_BUFFER_SIZE == 2))
91 99
   #error "RX_BUFFER_SIZE has to be a power of 2 and >= 2"
92 100
 #endif
101
+#if !((TX_BUFFER_SIZE == 256) ||(TX_BUFFER_SIZE == 128) ||(TX_BUFFER_SIZE == 64) ||(TX_BUFFER_SIZE == 32) ||(TX_BUFFER_SIZE == 16) ||(TX_BUFFER_SIZE == 8) ||(TX_BUFFER_SIZE == 4) ||(TX_BUFFER_SIZE == 2) ||(TX_BUFFER_SIZE == 0))
102
+  #error TX_BUFFER_SIZE has to be a power of 2 or 0
103
+#endif
93 104
 
94
-struct ring_buffer {
105
+struct ring_buffer_r {
95 106
   unsigned char buffer[RX_BUFFER_SIZE];
96 107
   volatile uint8_t head;
97 108
   volatile uint8_t tail;
98 109
 };
99 110
 
111
+#if TX_BUFFER_SIZE > 0
112
+  struct ring_buffer_t {
113
+    unsigned char buffer[TX_BUFFER_SIZE];
114
+    volatile uint8_t head;
115
+    volatile uint8_t tail;
116
+  };
117
+#endif
118
+
100 119
 #if UART_PRESENT(SERIAL_PORT)
101
-  extern ring_buffer rx_buffer;
120
+  extern ring_buffer_r rx_buffer;
121
+  #if TX_BUFFER_SIZE > 0
122
+    extern ring_buffer_t tx_buffer;
123
+  #endif
102 124
 #endif
103 125
 
104 126
 #if ENABLED(EMERGENCY_PARSER)
@@ -115,43 +137,13 @@ class MarlinSerial { //: public Stream
115 137
     int peek(void);
116 138
     int read(void);
117 139
     void flush(void);
118
-
119
-    FORCE_INLINE uint8_t available(void) {
120
-      CRITICAL_SECTION_START;
121
-        uint8_t h = rx_buffer.head;
122
-        uint8_t t = rx_buffer.tail;
123
-      CRITICAL_SECTION_END;
124
-      return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
125
-    }
126
-
127
-    FORCE_INLINE void write(uint8_t c) {
128
-      while (!TEST(M_UCSRxA, M_UDREx))
129
-        ;
130
-      M_UDRx = c;
131
-    }
132
-
133
-    FORCE_INLINE void checkRx(void) {
134
-      if (TEST(M_UCSRxA, M_RXCx)) {
135
-        unsigned char c  =  M_UDRx;
136
-        CRITICAL_SECTION_START;
137
-          uint8_t h = rx_buffer.head;
138
-          uint8_t i = (uint8_t)(h + 1) & (RX_BUFFER_SIZE - 1);
139
-
140
-          // if we should be storing the received character into the location
141
-          // just before the tail (meaning that the head would advance to the
142
-          // current location of the tail), we're about to overflow the buffer
143
-          // and so we don't write the character or advance the head.
144
-          if (i != rx_buffer.tail) {
145
-            rx_buffer.buffer[h] = c;
146
-            rx_buffer.head = i;
147
-          }
148
-        CRITICAL_SECTION_END;
149
-
150
-        #if ENABLED(EMERGENCY_PARSER)
151
-          emergency_parser(c);
152
-        #endif
153
-      }
154
-    }
140
+    uint8_t available(void);
141
+    void checkRx(void);
142
+    void write(uint8_t c);
143
+    #if TX_BUFFER_SIZE > 0
144
+      uint8_t availableForWrite(void);
145
+      void flushTX(void);
146
+    #endif
155 147
 
156 148
   private:
157 149
     void printNumber(unsigned long, uint8_t);

+ 6
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/Felix/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/K8200/Configuration_adv.h Zobrazit soubor

@@ -526,6 +526,12 @@ const unsigned int dropsegments = 2; //everything with less than this number of
526 526
 #define MAX_CMD_SIZE 96
527 527
 #define BUFSIZE 4
528 528
 
529
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
530
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
531
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
532
+// Any other output does not need to be that speedy.
533
+#define TX_BUFFER_SIZE 0
534
+
529 535
 // Enable an emergency-command parser to intercept certain commands as they
530 536
 // enter the serial receive buffer, so they cannot be blocked.
531 537
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/K8400/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 26
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 8
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h Zobrazit soubor

@@ -528,6 +528,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
528 528
 #define MAX_CMD_SIZE 96
529 529
 #define BUFSIZE 4
530 530
 
531
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
532
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
533
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
534
+// Any other output does not need to be that speedy.
535
+#define TX_BUFFER_SIZE 0
536
+
531 537
 // Enable an emergency-command parser to intercept certain commands as they
532 538
 // enter the serial receive buffer, so they cannot be blocked.
533 539
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h Zobrazit soubor

@@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
522 522
 #define MAX_CMD_SIZE 96
523 523
 #define BUFSIZE 4
524 524
 
525
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
526
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
527
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
528
+// Any other output does not need to be that speedy.
529
+#define TX_BUFFER_SIZE 0
530
+
525 531
 // Enable an emergency-command parser to intercept certain commands as they
526 532
 // enter the serial receive buffer, so they cannot be blocked.
527 533
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h Zobrazit soubor

@@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
522 522
 #define MAX_CMD_SIZE 96
523 523
 #define BUFSIZE 4
524 524
 
525
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
526
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
527
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
528
+// Any other output does not need to be that speedy.
529
+#define TX_BUFFER_SIZE 0
530
+
525 531
 // Enable an emergency-command parser to intercept certain commands as they
526 532
 // enter the serial receive buffer, so they cannot be blocked.
527 533
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Zobrazit soubor

@@ -521,6 +521,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
521 521
 #define MAX_CMD_SIZE 96
522 522
 #define BUFSIZE 4
523 523
 
524
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
525
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
526
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
527
+// Any other output does not need to be that speedy.
528
+#define TX_BUFFER_SIZE 0
529
+
524 530
 // Enable an emergency-command parser to intercept certain commands as they
525 531
 // enter the serial receive buffer, so they cannot be blocked.
526 532
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h Zobrazit soubor

@@ -526,6 +526,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
526 526
 #define MAX_CMD_SIZE 96
527 527
 #define BUFSIZE 4
528 528
 
529
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
530
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
531
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
532
+// Any other output does not need to be that speedy.
533
+#define TX_BUFFER_SIZE 0
534
+
529 535
 // Enable an emergency-command parser to intercept certain commands as they
530 536
 // enter the serial receive buffer, so they cannot be blocked.
531 537
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h Zobrazit soubor

@@ -522,6 +522,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
522 522
 #define MAX_CMD_SIZE 96
523 523
 #define BUFSIZE 4
524 524
 
525
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
526
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
527
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
528
+// Any other output does not need to be that speedy.
529
+#define TX_BUFFER_SIZE 0
530
+
525 531
 // Enable an emergency-command parser to intercept certain commands as they
526 532
 // enter the serial receive buffer, so they cannot be blocked.
527 533
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/makibox/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

+ 6
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Zobrazit soubor

@@ -520,6 +520,12 @@ const unsigned int dropsegments = 5; //everything with less than this number of
520 520
 #define MAX_CMD_SIZE 96
521 521
 #define BUFSIZE 4
522 522
 
523
+// Set Transfer-Buffer-Size by uncommenting the next define. Default size is 32byte.
524
+// :[0,2,4,8,16,32,64,128,256]. To save 386byte of PROGMEM and (3 + TX_BUFFER_SIZE) bytes of RAM set TX_BUFFER_SIZE to 0
525
+// To buffer a simple "ok" you need 4 byte, for ADVANCED_OK/M105 you need 32 and for debug-echo: 128 byte to get the optimal speed.
526
+// Any other output does not need to be that speedy.
527
+#define TX_BUFFER_SIZE 0
528
+
523 529
 // Enable an emergency-command parser to intercept certain commands as they
524 530
 // enter the serial receive buffer, so they cannot be blocked.
525 531
 // Currently handles M108, M112, M410

Loading…
Zrušit
Uložit