card.transfer_port => transfer_port_index
This commit is contained in:
parent
4ab433d391
commit
2c10222e87
4 changed files with 10 additions and 10 deletions
|
@ -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
|
||||||
|
|
|
@ -192,7 +192,7 @@ void GcodeSuite::M28() {
|
||||||
SERIAL_ECHOLN(p);
|
SERIAL_ECHOLN(p);
|
||||||
card.openFile(p, false);
|
card.openFile(p, false);
|
||||||
#if NUM_SERIAL > 1
|
#if NUM_SERIAL > 1
|
||||||
card.transfer_port = command_queue_port[cmd_queue_index_r];
|
card.transfer_port_index = command_queue_port[cmd_queue_index_r];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -52,7 +52,7 @@ char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENA
|
||||||
int8_t CardReader::autostart_index;
|
int8_t CardReader::autostart_index;
|
||||||
|
|
||||||
#if ENABLED(BINARY_FILE_TRANSFER) && NUM_SERIAL > 1
|
#if ENABLED(BINARY_FILE_TRANSFER) && NUM_SERIAL > 1
|
||||||
int8_t CardReader::transfer_port;
|
int8_t CardReader::transfer_port_index;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// private:
|
// private:
|
||||||
|
|
|
@ -147,9 +147,9 @@ public:
|
||||||
|
|
||||||
#if ENABLED(BINARY_FILE_TRANSFER)
|
#if ENABLED(BINARY_FILE_TRANSFER)
|
||||||
#if NUM_SERIAL > 1
|
#if NUM_SERIAL > 1
|
||||||
static int8_t transfer_port;
|
static int8_t transfer_port_index;
|
||||||
#else
|
#else
|
||||||
static constexpr int8_t transfer_port = 0;
|
static constexpr int8_t transfer_port_index = 0;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Reference in a new issue