|
@@ -84,7 +84,7 @@
|
84
|
84
|
// Currently looking for: M108, M112, M410
|
85
|
85
|
// If you alter the parser please don't forget to update the capabilities in Conditionals_post.h
|
86
|
86
|
|
87
|
|
- FORCE_INLINE void emergency_parser(const unsigned char c) {
|
|
87
|
+ FORCE_INLINE void emergency_parser(const uint8_t c) {
|
88
|
88
|
|
89
|
89
|
static e_parser_state state = state_RESET;
|
90
|
90
|
|
|
@@ -169,13 +169,16 @@
|
169
|
169
|
#endif // EMERGENCY_PARSER
|
170
|
170
|
|
171
|
171
|
FORCE_INLINE void store_rxd_char() {
|
|
172
|
+
|
172
|
173
|
const ring_buffer_pos_t h = rx_buffer.head,
|
173
|
174
|
i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1);
|
174
|
175
|
|
|
176
|
+ // Read the character
|
|
177
|
+ const uint8_t c = M_UDRx;
|
|
178
|
+
|
175
|
179
|
// If the character is to be stored at the index just before the tail
|
176
|
180
|
// (such that the head would advance to the current tail), the buffer is
|
177
|
181
|
// critical, so don't write the character or advance the head.
|
178
|
|
- const char c = M_UDRx;
|
179
|
182
|
if (i != rx_buffer.tail) {
|
180
|
183
|
rx_buffer.buffer[h] = c;
|
181
|
184
|
rx_buffer.head = i;
|
|
@@ -194,6 +197,7 @@
|
194
|
197
|
#endif
|
195
|
198
|
|
196
|
199
|
#if ENABLED(SERIAL_XON_XOFF)
|
|
200
|
+
|
197
|
201
|
// for high speed transfers, we can use XON/XOFF protocol to do
|
198
|
202
|
// software handshake and avoid overruns.
|
199
|
203
|
if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) {
|