|
|
@ -19,6 +19,7 @@
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* MarlinSerial_Due.h - Hardware serial library for Arduino DUE
|
|
|
|
* MarlinSerial_Due.h - Hardware serial library for Arduino DUE
|
|
|
@ -26,9 +27,6 @@
|
|
|
|
* Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved.
|
|
|
|
* Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MARLINSERIAL_DUE_H
|
|
|
|
|
|
|
|
#define MARLINSERIAL_DUE_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "../shared/MarlinSerial.h"
|
|
|
|
#include "../shared/MarlinSerial.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <WString.h>
|
|
|
|
#include <WString.h>
|
|
|
@ -159,11 +157,10 @@ private:
|
|
|
|
static void printFloat(double, uint8_t);
|
|
|
|
static void printFloat(double, uint8_t);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#if SERIAL_PORT >= 0
|
|
|
|
// Serial port configuration
|
|
|
|
|
|
|
|
template <uint8_t serial>
|
|
|
|
// Serial port configuration
|
|
|
|
struct MarlinSerialCfg {
|
|
|
|
struct MarlinSerialCfg1 {
|
|
|
|
static constexpr int PORT = serial;
|
|
|
|
static constexpr int PORT = SERIAL_PORT;
|
|
|
|
|
|
|
|
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE;
|
|
|
|
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE;
|
|
|
|
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE;
|
|
|
|
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE;
|
|
|
|
static constexpr bool XONOFF = bSERIAL_XON_XOFF;
|
|
|
|
static constexpr bool XONOFF = bSERIAL_XON_XOFF;
|
|
|
@ -172,29 +169,17 @@ private:
|
|
|
|
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS;
|
|
|
|
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS;
|
|
|
|
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS;
|
|
|
|
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS;
|
|
|
|
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED;
|
|
|
|
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern MarlinSerial<MarlinSerialCfg1> customizedSerial1;
|
|
|
|
#if SERIAL_PORT >= 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
|
|
|
|
|
|
|
|
|
|
|
|
#endif // SERIAL_PORT >= 0
|
|
|
|
#endif // SERIAL_PORT >= 0
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SERIAL_PORT_2
|
|
|
|
#ifdef SERIAL_PORT_2
|
|
|
|
|
|
|
|
|
|
|
|
// Serial port configuration
|
|
|
|
extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2;
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
#endif // MARLINSERIAL_DUE_H
|
|
|
|
|
|
|
|