Browse Source

Tweak to serial macros

pull/1/head
Scott Lahteine 7 years ago
parent
commit
49c693c85b
  1. 16
      Marlin/src/core/serial.h

16
Marlin/src/core/serial.h

@ -73,16 +73,16 @@ extern const char errormagic[] PROGMEM;
#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x))) #define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x)))
#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL(); }while(0) #define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL(); }while(0)
#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x "\n"))) #define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x "\n")))
#define SERIAL_PROTOCOLPAIR(name, value) (serial_echopair_P(PSTR(name),(value))) #define SERIAL_PROTOCOLPAIR(pre, value) (serial_echopair_P(PSTR(pre),(value)))
#define SERIAL_PROTOCOLLNPAIR(name, value) do{ SERIAL_PROTOCOLPAIR(name, value); SERIAL_EOL(); }while(0) #define SERIAL_PROTOCOLLNPAIR(pre, value) do{ SERIAL_PROTOCOLPAIR(pre, value); SERIAL_EOL(); }while(0)
#define SERIAL_ECHO_START() (serialprintPGM(echomagic)) #define SERIAL_ECHO_START() (serialprintPGM(echomagic))
#define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
#define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
#define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
#define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x) #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
#define SERIAL_ECHOPAIR(name,value) SERIAL_PROTOCOLPAIR(name, value) #define SERIAL_ECHOPAIR(pre,value) SERIAL_PROTOCOLPAIR(pre, value)
#define SERIAL_ECHOLNPAIR(name, value) SERIAL_PROTOCOLLNPAIR(name, value) #define SERIAL_ECHOLNPAIR(pre, value) SERIAL_PROTOCOLLNPAIR(pre, value)
#define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x,y) #define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x,y)
#define SERIAL_ERROR_START() (serialprintPGM(errormagic)) #define SERIAL_ERROR_START() (serialprintPGM(errormagic))
@ -92,10 +92,10 @@ extern const char errormagic[] PROGMEM;
#define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
// These macros compensate for float imprecision // These macros compensate for float imprecision
#define SERIAL_PROTOCOLPAIR_F(name, value) SERIAL_PROTOCOLPAIR(name, FIXFLOAT(value)) #define SERIAL_PROTOCOLPAIR_F(pre, value) SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value))
#define SERIAL_PROTOCOLLNPAIR_F(name, value) SERIAL_PROTOCOLLNPAIR(name, FIXFLOAT(value)) #define SERIAL_PROTOCOLLNPAIR_F(pre, value) SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value))
#define SERIAL_ECHOPAIR_F(name,value) SERIAL_ECHOPAIR(name, FIXFLOAT(value)) #define SERIAL_ECHOPAIR_F(pre,value) SERIAL_ECHOPAIR(pre, FIXFLOAT(value))
#define SERIAL_ECHOLNPAIR_F(name, value) SERIAL_ECHOLNPAIR(name, FIXFLOAT(value)) #define SERIAL_ECHOLNPAIR_F(pre, value) SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value))
void serial_echopair_P(const char* s_P, const char *v); void serial_echopair_P(const char* s_P, const char *v);
void serial_echopair_P(const char* s_P, char v); void serial_echopair_P(const char* s_P, char v);

Loading…
Cancel
Save