From 3700f688f5eb62843c2dba02fdeffeecf92bd1e4 Mon Sep 17 00:00:00 2001 From: "hg42@gmx.net" Date: Thu, 1 Aug 2013 14:56:39 +0200 Subject: [PATCH] convert PROTOCOL macros from statements to (multiple, comma separated) expressions --- Marlin/Marlin.h | 14 +++++++------- Marlin/temperature.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index b92d81072..988170789 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -51,22 +51,22 @@ #define MYSERIAL MSerial #endif -#define SERIAL_PROTOCOL(x) MYSERIAL.print(x); -#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y); -#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)); -#define SERIAL_PROTOCOLLN(x) {MYSERIAL.print(x);MYSERIAL.write('\n');} -#define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(PSTR(x));MYSERIAL.write('\n');} +#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x)) +#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y)) +#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x))) +#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n')) +#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n')) const char errormagic[] PROGMEM ="Error:"; const char echomagic[] PROGMEM ="echo:"; -#define SERIAL_ERROR_START serialprintPGM(errormagic); +#define SERIAL_ERROR_START (serialprintPGM(errormagic)) #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHO_START serialprintPGM(echomagic); +#define SERIAL_ECHO_START (serialprintPGM(echomagic)) #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index f5df7a1e7..c732716b1 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -244,7 +244,7 @@ void PID_autotune(float temp, int extruder, int ncycles) Kp = 0.6*Ku; Ki = 2*Kp/Tu; Kd = Kp*Tu/8; - SERIAL_PROTOCOLLNPGM(" Clasic PID ") + SERIAL_PROTOCOLLNPGM(" Clasic PID "); SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp); SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd);