|
|
@ -367,8 +367,8 @@ void gcode_line_error(PGM_P const err, const int8_t port) {
|
|
|
|
stream_state = StreamState::PACKET_TIMEOUT;
|
|
|
|
stream_state = StreamState::PACKET_TIMEOUT;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!serial_data_available(card.transfer_port)) return false;
|
|
|
|
if (!serial_data_available(card.transfer_port_index)) return false;
|
|
|
|
data = read_serial(card.transfer_port);
|
|
|
|
data = read_serial(card.transfer_port_index);
|
|
|
|
packet.timeout = millis() + STREAM_MAX_WAIT;
|
|
|
|
packet.timeout = millis() + STREAM_MAX_WAIT;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -379,7 +379,7 @@ void gcode_line_error(PGM_P const err, const int8_t port) {
|
|
|
|
millis_t transfer_timeout = millis() + RX_TIMESLICE;
|
|
|
|
millis_t transfer_timeout = millis() + RX_TIMESLICE;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
PORT_REDIRECT(card.transfer_port);
|
|
|
|
PORT_REDIRECT(card.transfer_port_index);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
while (PENDING(millis(), transfer_timeout)) {
|
|
|
|
while (PENDING(millis(), transfer_timeout)) {
|
|
|
@ -491,8 +491,8 @@ void gcode_line_error(PGM_P const err, const int8_t port) {
|
|
|
|
stream_state = StreamState::PACKET_RESEND;
|
|
|
|
stream_state = StreamState::PACKET_RESEND;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!serial_data_available(card.transfer_port)) break;
|
|
|
|
if (!serial_data_available(card.transfer_port_index)) break;
|
|
|
|
read_serial(card.transfer_port); // throw away data
|
|
|
|
read_serial(card.transfer_port_index); // throw away data
|
|
|
|
packet.timeout = millis() + STREAM_MAX_WAIT;
|
|
|
|
packet.timeout = millis() + STREAM_MAX_WAIT;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case StreamState::PACKET_TIMEOUT:
|
|
|
|
case StreamState::PACKET_TIMEOUT:
|
|
|
@ -558,7 +558,7 @@ inline void get_serial_commands() {
|
|
|
|
* receive buffer (which limits the packet size to MAX_CMD_SIZE).
|
|
|
|
* receive buffer (which limits the packet size to MAX_CMD_SIZE).
|
|
|
|
* The receive buffer also limits the packet size for reliable transmission.
|
|
|
|
* The receive buffer also limits the packet size for reliable transmission.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
binaryStream.receive(serial_line_buffer[card.transfer_port]);
|
|
|
|
binaryStream.receive(serial_line_buffer[card.transfer_port_index]);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|