|
|
@ -103,15 +103,15 @@ class AnycubicSerialClass : public Stream { |
|
|
|
extern void serialEventRun(void) __attribute__((weak)); |
|
|
|
|
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOL(x) (AnycubicSerial.print(x)) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOL_F(x,y) (AnycubicSerial.print(x,y)) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOL_F(x,y) (AnycubicSerial.print(x, y)) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOLPGM(x) (AnycubicSerialprintPGM(PSTR(x))) |
|
|
|
#define ANYCUBIC_SERIAL_(x) (AnycubicSerial.print(x),AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOLLN(x) (AnycubicSerial.print(x),AnycubicSerial.write('\r'),AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOLLNPGM(x) (AnycubicSerialprintPGM(PSTR(x)),AnycubicSerial.write('\r'),AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_(x) (AnycubicSerial.print(x), AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOLLN(x) (AnycubicSerial.print(x), AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_PROTOCOLLNPGM(x) (AnycubicSerialprintPGM(PSTR(x)), AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) |
|
|
|
|
|
|
|
#define ANYCUBIC_SERIAL_START() (AnycubicSerial.write('\r'),AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_CMD_SEND(x) (AnycubicSerialprintPGM(PSTR(x)),AnycubicSerial.write('\r'),AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_ENTER() (AnycubicSerial.write('\r'),AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_START() (AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_CMD_SEND(x) (AnycubicSerialprintPGM(PSTR(x)), AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_ENTER() (AnycubicSerial.write('\r'), AnycubicSerial.write('\n')) |
|
|
|
#define ANYCUBIC_SERIAL_SPACE() (AnycubicSerial.write(' ')) |
|
|
|
|
|
|
|
const char newErr[] PROGMEM = "ERR "; |
|
|
@ -130,14 +130,16 @@ const char newSucc[] PROGMEM = "OK"; |
|
|
|
#define ANYCUBIC_SERIAL_ECHOPGM(x) ANYCUBIC_SERIAL_PROTOCOLPGM(x) |
|
|
|
#define ANYCUBIC_SERIAL_ECHO(x) ANYCUBIC_SERIAL_PROTOCOL(x) |
|
|
|
|
|
|
|
FORCE_INLINE void AnycubicSerialprintPGM(const char *str) { |
|
|
|
char ch = pgm_read_byte(str); |
|
|
|
while (ch) { |
|
|
|
AnycubicSerialClass::write(ch); |
|
|
|
ch = pgm_read_byte(++str); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef UBRR3H |
|
|
|
|
|
|
|
extern AnycubicSerialClass AnycubicSerial; |
|
|
|
|
|
|
|
FORCE_INLINE void AnycubicSerialprintPGM(const char *str) { |
|
|
|
char ch = pgm_read_byte(str); |
|
|
|
while (ch) { |
|
|
|
AnycubicSerial.write(ch); |
|
|
|
ch = pgm_read_byte(++str); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|