Explorar el Código

convert PROTOCOL macros from statements to (multiple, comma separated) expressions

hg42@gmx.net hace 11 años
padre
commit
3700f688f5
Se han modificado 2 ficheros con 8 adiciones y 8 borrados
  1. 7
    7
      Marlin/Marlin.h
  2. 1
    1
      Marlin/temperature.cpp

+ 7
- 7
Marlin/Marlin.h Ver fichero

@@ -51,22 +51,22 @@
51 51
   #define MYSERIAL MSerial
52 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 61
 const char errormagic[] PROGMEM ="Error:";
62 62
 const char echomagic[] PROGMEM ="echo:";
63
-#define SERIAL_ERROR_START serialprintPGM(errormagic);
63
+#define SERIAL_ERROR_START (serialprintPGM(errormagic))
64 64
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
65 65
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
66 66
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
67 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 70
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
71 71
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
72 72
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)

+ 1
- 1
Marlin/temperature.cpp Ver fichero

@@ -244,7 +244,7 @@ void PID_autotune(float temp, int extruder, int ncycles)
244 244
               Kp = 0.6*Ku;
245 245
               Ki = 2*Kp/Tu;
246 246
               Kd = Kp*Tu/8;
247
-              SERIAL_PROTOCOLLNPGM(" Clasic PID ")
247
+              SERIAL_PROTOCOLLNPGM(" Clasic PID ");
248 248
               SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp);
249 249
               SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki);
250 250
               SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd);

Loading…
Cancelar
Guardar