From 2c10222e87925afa0c4adfbd15321866fbea23fc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 27 Feb 2019 20:14:17 -0600 Subject: [PATCH] card.transfer_port => transfer_port_index --- Marlin/src/gcode/queue.cpp | 12 ++++++------ .../src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- Marlin/src/sd/cardreader.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index d697baae0..4e9a47eaf 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -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 diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp index f6725358c..af8b72ae2 100644 --- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp +++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp @@ -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 diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 971f89557..d76bbe8c9 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -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: diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 4e86be70f..a13633eaf 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -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