|
|
@ -31,8 +31,6 @@ |
|
|
|
|
|
|
|
#include "../shared/MarlinSerial.h" |
|
|
|
|
|
|
|
#if SERIAL_PORT >= 0 |
|
|
|
|
|
|
|
#include <WString.h> |
|
|
|
|
|
|
|
#define DEC 10 |
|
|
@ -161,21 +159,42 @@ private: |
|
|
|
static void printFloat(double, uint8_t); |
|
|
|
}; |
|
|
|
|
|
|
|
// Serial port configuration
|
|
|
|
struct MarlinSerialCfg { |
|
|
|
static constexpr int PORT = SERIAL_PORT; |
|
|
|
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE; |
|
|
|
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE; |
|
|
|
static constexpr bool XONOFF = bSERIAL_XON_XOFF; |
|
|
|
static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER; |
|
|
|
static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX; |
|
|
|
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS; |
|
|
|
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS; |
|
|
|
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED; |
|
|
|
}; |
|
|
|
#if SERIAL_PORT >= 0 |
|
|
|
|
|
|
|
// Serial port configuration
|
|
|
|
struct MarlinSerialCfg1 { |
|
|
|
static constexpr int PORT = SERIAL_PORT; |
|
|
|
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE; |
|
|
|
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE; |
|
|
|
static constexpr bool XONOFF = bSERIAL_XON_XOFF; |
|
|
|
static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER; |
|
|
|
static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX; |
|
|
|
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS; |
|
|
|
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS; |
|
|
|
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED; |
|
|
|
}; |
|
|
|
|
|
|
|
extern MarlinSerial<MarlinSerialCfg> customizedSerial; |
|
|
|
extern MarlinSerial<MarlinSerialCfg1> customizedSerial1; |
|
|
|
|
|
|
|
#endif // SERIAL_PORT >= 0
|
|
|
|
|
|
|
|
#ifdef SERIAL_PORT_2 |
|
|
|
|
|
|
|
// Serial port configuration
|
|
|
|
struct MarlinSerialCfg2 { |
|
|
|
static constexpr int PORT = SERIAL_PORT_2; |
|
|
|
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE; |
|
|
|
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE; |
|
|
|
static constexpr bool XONOFF = bSERIAL_XON_XOFF; |
|
|
|
static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER; |
|
|
|
static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX; |
|
|
|
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS; |
|
|
|
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS; |
|
|
|
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED; |
|
|
|
}; |
|
|
|
|
|
|
|
extern MarlinSerial<MarlinSerialCfg2> customizedSerial2; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // MARLINSERIAL_DUE_H
|
|
|
|