card.transfer_port => transfer_port_index

This commit is contained in:
Scott Lahteine 2019-02-27 20:14:17 -06:00
parent 4ab433d391
commit 2c10222e87
4 changed files with 10 additions and 10 deletions

View File

@ -367,8 +367,8 @@ void gcode_line_error(PGM_P const err, const int8_t port) {
stream_state = StreamState::PACKET_TIMEOUT;
return false;
}
if (!serial_data_available(card.transfer_port)) return false;
data = read_serial(card.transfer_port);
if (!serial_data_available(card.transfer_port_index)) return false;
data = read_serial(card.transfer_port_index);
packet.timeout = millis() + STREAM_MAX_WAIT;
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;
#if ENABLED(SDSUPPORT)
PORT_REDIRECT(card.transfer_port);
PORT_REDIRECT(card.transfer_port_index);
#endif
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;
break;
}
if (!serial_data_available(card.transfer_port)) break;
read_serial(card.transfer_port); // throw away data
if (!serial_data_available(card.transfer_port_index)) break;
read_serial(card.transfer_port_index); // throw away data
packet.timeout = millis() + STREAM_MAX_WAIT;
break;
case StreamState::PACKET_TIMEOUT:
@ -558,7 +558,7 @@ inline void get_serial_commands() {
* receive buffer (which limits the packet size to MAX_CMD_SIZE).
* 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;
}
#endif

View File

@ -192,7 +192,7 @@ void GcodeSuite::M28() {
SERIAL_ECHOLN(p);
card.openFile(p, false);
#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
}
else

View File

@ -52,7 +52,7 @@ char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENA
int8_t CardReader::autostart_index;
#if ENABLED(BINARY_FILE_TRANSFER) && NUM_SERIAL > 1
int8_t CardReader::transfer_port;
int8_t CardReader::transfer_port_index;
#endif
// private:

View File

@ -147,9 +147,9 @@ public:
#if ENABLED(BINARY_FILE_TRANSFER)
#if NUM_SERIAL > 1
static int8_t transfer_port;
static int8_t transfer_port_index;
#else
static constexpr int8_t transfer_port = 0;
static constexpr int8_t transfer_port_index = 0;
#endif
#endif