Fix serial index types

This commit is contained in:
Scott Lahteine 2021-03-10 11:33:29 -06:00
parent b75e682c50
commit fe0b770033
4 changed files with 6 additions and 6 deletions

View file

@ -29,11 +29,11 @@
#include "../libs/heatshrink/heatshrink_decoder.h" #include "../libs/heatshrink/heatshrink_decoder.h"
#endif #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); 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); return SERIAL_IMPL.read(index);
} }

View file

@ -393,7 +393,7 @@ void GCodeQueue::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[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; return;
} }
#endif #endif

View file

@ -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_DISABLED(NO_SD_AUTOSTART, uint8_t CardReader::autofile_index); // = 0
#if BOTH(HAS_MULTI_SERIAL, BINARY_FILE_TRANSFER) #if BOTH(HAS_MULTI_SERIAL, BINARY_FILE_TRANSFER)
int8_t CardReader::transfer_port_index; serial_index_t CardReader::transfer_port_index;
#endif #endif
// private: // private:

View file

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