Browse Source

Fix serial index types

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
e1cca6d97b
  1. 4
      Marlin/src/feature/binary_stream.h
  2. 2
      Marlin/src/gcode/queue.cpp
  3. 2
      Marlin/src/sd/cardreader.cpp
  4. 4
      Marlin/src/sd/cardreader.h

4
Marlin/src/feature/binary_stream.h

@ -29,11 +29,11 @@
#include "../libs/heatshrink/heatshrink_decoder.h"
#endif
inline bool bs_serial_data_available(const uint8_t index) {
inline bool bs_serial_data_available(const serial_index_t index) {
return SERIAL_IMPL.available(index);
}
inline int bs_read_serial(const uint8_t index) {
inline int bs_read_serial(const serial_index_t index) {
return SERIAL_IMPL.read(index);
}

2
Marlin/src/gcode/queue.cpp

@ -393,7 +393,7 @@ void GCodeQueue::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[card.transfer_port_index].receive(serial_state[card.transfer_port_index].line_buffer);
binaryStream[card.transfer_port_index.index].receive(serial_state[card.transfer_port_index.index].line_buffer);
return;
}
#endif

2
Marlin/src/sd/cardreader.cpp

@ -70,7 +70,7 @@ char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENA
IF_DISABLED(NO_SD_AUTOSTART, uint8_t CardReader::autofile_index); // = 0
#if BOTH(HAS_MULTI_SERIAL, BINARY_FILE_TRANSFER)
int8_t CardReader::transfer_port_index;
serial_index_t CardReader::transfer_port_index;
#endif
// private:

4
Marlin/src/sd/cardreader.h

@ -72,9 +72,9 @@ public:
// Fast! binary file transfer
#if ENABLED(BINARY_FILE_TRANSFER)
#if HAS_MULTI_SERIAL
static int8_t transfer_port_index;
static serial_index_t transfer_port_index;
#else
static constexpr int8_t transfer_port_index = 0;
static constexpr serial_index_t transfer_port_index = 0;
#endif
#endif

Loading…
Cancel
Save