Browse Source

Merge pull request #569 from hg42/convert-PROTOCOL-macros-from-statements-to-expressions

convert PROTOCOL macros from statements to (multiple, comma separated) expressions
ErikZalm 11 years ago
parent
commit
07e7de3600
2 changed files with 8 additions and 8 deletions
  1. 7
    7
      Marlin/Marlin.h
  2. 1
    1
      Marlin/temperature.cpp

+ 7
- 7
Marlin/Marlin.h View File

51
   #define MYSERIAL MSerial
51
   #define MYSERIAL MSerial
52
 #endif
52
 #endif
53
 
53
 
54
-#define SERIAL_PROTOCOL(x) MYSERIAL.print(x);
55
-#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y);
56
-#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x));
57
-#define SERIAL_PROTOCOLLN(x) {MYSERIAL.print(x);MYSERIAL.write('\n');}
58
-#define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(PSTR(x));MYSERIAL.write('\n');}
54
+#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))
55
+#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y))
56
+#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x)))
57
+#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n'))
58
+#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n'))
59
 
59
 
60
 
60
 
61
 const char errormagic[] PROGMEM ="Error:";
61
 const char errormagic[] PROGMEM ="Error:";
62
 const char echomagic[] PROGMEM ="echo:";
62
 const char echomagic[] PROGMEM ="echo:";
63
-#define SERIAL_ERROR_START serialprintPGM(errormagic);
63
+#define SERIAL_ERROR_START (serialprintPGM(errormagic))
64
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
64
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
65
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
65
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
66
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
66
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
67
 #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
67
 #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
68
 
68
 
69
-#define SERIAL_ECHO_START serialprintPGM(echomagic);
69
+#define SERIAL_ECHO_START (serialprintPGM(echomagic))
70
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
70
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
71
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
71
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
72
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
72
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)

+ 1
- 1
Marlin/temperature.cpp View File

244
               Kp = 0.6*Ku;
244
               Kp = 0.6*Ku;
245
               Ki = 2*Kp/Tu;
245
               Ki = 2*Kp/Tu;
246
               Kd = Kp*Tu/8;
246
               Kd = Kp*Tu/8;
247
-              SERIAL_PROTOCOLLNPGM(" Clasic PID ")
247
+              SERIAL_PROTOCOLLNPGM(" Clasic PID ");
248
               SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp);
248
               SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp);
249
               SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki);
249
               SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki);
250
               SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd);
250
               SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd);

Loading…
Cancel
Save