Преглед изворни кода

A single SERIAL_ECHO macro type (#12557)

Scott Lahteine пре 5 година
родитељ
комит
c986239837
No account linked to committer's email address
86 измењених фајлова са 1026 додато и 1366 уклоњено
  1. 1
    2
      Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp
  2. 34
    34
      Marlin/src/HAL/HAL_AVR/pinsDebug.h
  3. 1
    2
      Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
  4. 2
    2
      Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp
  5. 1
    2
      Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
  6. 1
    1
      Marlin/src/HAL/HAL_DUE/pinsDebug.h
  7. 2
    2
      Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp
  8. 11
    11
      Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp
  9. 1
    2
      Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp
  10. 1
    2
      Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp
  11. 1
    2
      Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp
  12. 1
    2
      Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp
  13. 1
    2
      Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp
  14. 1
    2
      Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp
  15. 1
    1
      Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h
  16. 1
    2
      Marlin/src/HAL/shared/backtrace/backtrace.cpp
  17. 6
    11
      Marlin/src/Marlin.cpp
  18. 18
    18
      Marlin/src/core/serial.cpp
  19. 126
    160
      Marlin/src/core/serial.h
  20. 17
    28
      Marlin/src/feature/I2CPositionEncoder.cpp
  21. 2
    2
      Marlin/src/feature/I2CPositionEncoder.h
  22. 16
    16
      Marlin/src/feature/bedlevel/bedlevel.cpp
  23. 2
    3
      Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp
  24. 17
    19
      Marlin/src/feature/bedlevel/ubl/ubl.cpp
  25. 3
    9
      Marlin/src/feature/bedlevel/ubl/ubl.h
  26. 122
    163
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  27. 1
    2
      Marlin/src/feature/dac/stepper_dac.cpp
  28. 4
    8
      Marlin/src/feature/pause.cpp
  29. 3
    3
      Marlin/src/feature/runout.h
  30. 1
    2
      Marlin/src/feature/solenoid.cpp
  31. 4
    4
      Marlin/src/feature/tmc_util.cpp
  32. 1
    2
      Marlin/src/feature/twibus.cpp
  33. 12
    12
      Marlin/src/gcode/bedlevel/G26.cpp
  34. 6
    8
      Marlin/src/gcode/bedlevel/M420.cpp
  35. 31
    39
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  36. 4
    8
      Marlin/src/gcode/bedlevel/abl/M421.cpp
  37. 12
    12
      Marlin/src/gcode/bedlevel/mbl/G29.cpp
  38. 4
    8
      Marlin/src/gcode/bedlevel/mbl/M421.cpp
  39. 4
    8
      Marlin/src/gcode/bedlevel/ubl/M421.cpp
  40. 1
    1
      Marlin/src/gcode/bedlevel/ubl/M49.cpp
  41. 2
    4
      Marlin/src/gcode/calibrate/G28.cpp
  42. 28
    33
      Marlin/src/gcode/calibrate/G33.cpp
  43. 3
    3
      Marlin/src/gcode/calibrate/G34_M422.cpp
  44. 21
    35
      Marlin/src/gcode/calibrate/M48.cpp
  45. 2
    4
      Marlin/src/gcode/calibrate/M665.cpp
  46. 1
    3
      Marlin/src/gcode/calibrate/M852.cpp
  47. 2
    4
      Marlin/src/gcode/config/M200-M205.cpp
  48. 2
    4
      Marlin/src/gcode/config/M301.cpp
  49. 32
    34
      Marlin/src/gcode/config/M43.cpp
  50. 2
    4
      Marlin/src/gcode/eeprom/M500-M504.cpp
  51. 2
    2
      Marlin/src/gcode/feature/advance/M900.cpp
  52. 1
    2
      Marlin/src/gcode/feature/caselight/M355.cpp
  53. 3
    6
      Marlin/src/gcode/feature/filwidth/M404-M407.cpp
  54. 3
    6
      Marlin/src/gcode/feature/i2c/M260_M261.cpp
  55. 2
    4
      Marlin/src/gcode/feature/macro/M810-M819.cpp
  56. 3
    6
      Marlin/src/gcode/gcode.cpp
  57. 1
    1
      Marlin/src/gcode/geometry/G53-G59.cpp
  58. 1
    2
      Marlin/src/gcode/geometry/M206_M428.cpp
  59. 12
    12
      Marlin/src/gcode/host/M114.cpp
  60. 3
    3
      Marlin/src/gcode/host/M115.cpp
  61. 2
    4
      Marlin/src/gcode/lcd/M145.cpp
  62. 1
    1
      Marlin/src/gcode/lcd/M250.cpp
  63. 5
    9
      Marlin/src/gcode/motion/G2_G3.cpp
  64. 1
    2
      Marlin/src/gcode/motion/G5.cpp
  65. 3
    3
      Marlin/src/gcode/probe/G30.cpp
  66. 1
    4
      Marlin/src/gcode/probe/G38.cpp
  67. 3
    8
      Marlin/src/gcode/probe/M851.cpp
  68. 13
    14
      Marlin/src/gcode/queue.cpp
  69. 2
    2
      Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
  70. 2
    3
      Marlin/src/gcode/temperature/M105.cpp
  71. 1
    1
      Marlin/src/lcd/menu/menu_ubl.cpp
  72. 6
    10
      Marlin/src/libs/vector_3.cpp
  73. 180
    280
      Marlin/src/module/configuration_store.cpp
  74. 19
    19
      Marlin/src/module/endstops.cpp
  75. 7
    14
      Marlin/src/module/motion.cpp
  76. 2
    4
      Marlin/src/module/planner.cpp
  77. 3
    3
      Marlin/src/module/printcounter.cpp
  78. 7
    15
      Marlin/src/module/probe.cpp
  79. 2
    2
      Marlin/src/module/scara.cpp
  80. 46
    47
      Marlin/src/module/stepper.cpp
  81. 62
    62
      Marlin/src/module/temperature.cpp
  82. 1
    2
      Marlin/src/module/tool_change.cpp
  83. 10
    10
      Marlin/src/pins/pinsDebug.h
  84. 1
    1
      Marlin/src/sd/SdBaseFile.cpp
  85. 1
    1
      Marlin/src/sd/SdBaseFile.h
  86. 41
    56
      Marlin/src/sd/cardreader.cpp

+ 1
- 2
Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp Прегледај датотеку

@@ -39,8 +39,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
39 39
     if (v != eeprom_read_byte(p)) {
40 40
       eeprom_write_byte(p, v);
41 41
       if (eeprom_read_byte(p) != v) {
42
-        SERIAL_ECHO_START();
43
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
42
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
44 43
         return true;
45 44
       }
46 45
     }

+ 34
- 34
Marlin/src/HAL/HAL_AVR/pinsDebug.h Прегледај датотеку

@@ -150,7 +150,7 @@ static bool pwm_status(uint8_t pin) {
150 150
     default:
151 151
       return false;
152 152
   }
153
-  SERIAL_PROTOCOL_SP(2);
153
+  SERIAL_ECHO_SP(2);
154 154
 } // pwm_status
155 155
 
156 156
 
@@ -222,24 +222,24 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
222 222
 
223 223
 #define OCR_VAL(T, L)   pgm_read_word(&PWM_OCR[T][L])
224 224
 
225
-static void err_is_counter()     { SERIAL_PROTOCOLPGM("   non-standard PWM mode"); }
226
-static void err_is_interrupt()   { SERIAL_PROTOCOLPGM("   compare interrupt enabled"); }
227
-static void err_prob_interrupt() { SERIAL_PROTOCOLPGM("   overflow interrupt enabled"); }
228
-static void print_is_also_tied() { SERIAL_PROTOCOLPGM(" is also tied to this pin"); SERIAL_PROTOCOL_SP(14); }
225
+static void err_is_counter()     { SERIAL_ECHOPGM("   non-standard PWM mode"); }
226
+static void err_is_interrupt()   { SERIAL_ECHOPGM("   compare interrupt enabled"); }
227
+static void err_prob_interrupt() { SERIAL_ECHOPGM("   overflow interrupt enabled"); }
228
+static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); SERIAL_ECHO_SP(14); }
229 229
 
230 230
 void com_print(uint8_t N, uint8_t Z) {
231 231
   const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
232
-  SERIAL_PROTOCOLPGM("    COM");
233
-  SERIAL_PROTOCOLCHAR(N + '0');
232
+  SERIAL_ECHOPGM("    COM");
233
+  SERIAL_CHAR(N + '0');
234 234
   switch (Z) {
235 235
     case 'A':
236
-      SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6));
236
+      SERIAL_ECHOPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6));
237 237
       break;
238 238
     case 'B':
239
-      SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4));
239
+      SERIAL_ECHOPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4));
240 240
       break;
241 241
     case 'C':
242
-      SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2));
242
+      SERIAL_ECHOPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2));
243 243
       break;
244 244
   }
245 245
 }
@@ -251,10 +251,10 @@ void timer_prefix(uint8_t T, char L, uint8_t N) {  // T - timer    L - pwm  N -
251 251
   uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
252 252
   if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
253 253
 
254
-  SERIAL_PROTOCOLPGM("    TIMER");
255
-  SERIAL_PROTOCOLCHAR(T + '0');
256
-  SERIAL_PROTOCOLCHAR(L);
257
-  SERIAL_PROTOCOL_SP(3);
254
+  SERIAL_ECHOPGM("    TIMER");
255
+  SERIAL_CHAR(T + '0');
256
+  SERIAL_CHAR(L);
257
+  SERIAL_ECHO_SP(3);
258 258
 
259 259
   if (N == 3) {
260 260
     const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A');
@@ -264,22 +264,22 @@ void timer_prefix(uint8_t T, char L, uint8_t N) {  // T - timer    L - pwm  N -
264 264
     const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A');
265 265
     PWM_PRINT(*OCRVAL16);
266 266
   }
267
-  SERIAL_PROTOCOLPAIR("    WGM: ", WGM);
267
+  SERIAL_ECHOPAIR("    WGM: ", WGM);
268 268
   com_print(T,L);
269
-  SERIAL_PROTOCOLPAIR("    CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
269
+  SERIAL_ECHOPAIR("    CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
270 270
 
271
-  SERIAL_PROTOCOLPGM("    TCCR");
272
-  SERIAL_PROTOCOLCHAR(T + '0');
273
-  SERIAL_PROTOCOLPAIR("A: ", *TCCRA);
271
+  SERIAL_ECHOPGM("    TCCR");
272
+  SERIAL_CHAR(T + '0');
273
+  SERIAL_ECHOPAIR("A: ", *TCCRA);
274 274
 
275
-  SERIAL_PROTOCOLPGM("    TCCR");
276
-  SERIAL_PROTOCOLCHAR(T + '0');
277
-  SERIAL_PROTOCOLPAIR("B: ", *TCCRB);
275
+  SERIAL_ECHOPGM("    TCCR");
276
+  SERIAL_CHAR(T + '0');
277
+  SERIAL_ECHOPAIR("B: ", *TCCRB);
278 278
 
279 279
   const uint8_t *TMSK = (uint8_t*)TIMSK(T);
280
-  SERIAL_PROTOCOLPGM("    TIMSK");
281
-  SERIAL_PROTOCOLCHAR(T + '0');
282
-  SERIAL_PROTOCOLPAIR(": ", *TMSK);
280
+  SERIAL_ECHOPGM("    TIMSK");
281
+  SERIAL_CHAR(T + '0');
282
+  SERIAL_ECHOPAIR(": ", *TMSK);
283 283
 
284 284
   const uint8_t OCIE = L - 'A' + 1;
285 285
   if (N == 3) { if (WGM == 0 || WGM == 2 || WGM ==  4 || WGM ==  6) err_is_counter(); }
@@ -336,22 +336,22 @@ static void pwm_details(uint8_t pin) {
336 336
     case NOT_ON_TIMER: break;
337 337
 
338 338
   }
339
-  SERIAL_PROTOCOLPGM("  ");
339
+  SERIAL_ECHOPGM("  ");
340 340
 
341 341
   // on pins that have two PWMs, print info on second PWM
342 342
   #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY
343 343
     // looking for port B7 - PWMs 0A and 1C
344 344
     if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask_DEBUG(pin)) {
345 345
       #if !AVR_AT90USB1286_FAMILY
346
-        SERIAL_PROTOCOLPGM("\n .");
347
-        SERIAL_PROTOCOL_SP(18);
348
-        SERIAL_PROTOCOLPGM("TIMER1C");
346
+        SERIAL_ECHOPGM("\n .");
347
+        SERIAL_ECHO_SP(18);
348
+        SERIAL_ECHOPGM("TIMER1C");
349 349
         print_is_also_tied();
350 350
         timer_prefix(1, 'C', 4);
351 351
       #else
352
-        SERIAL_PROTOCOLPGM("\n .");
353
-        SERIAL_PROTOCOL_SP(18);
354
-        SERIAL_PROTOCOLPGM("TIMER0A");
352
+        SERIAL_ECHOPGM("\n .");
353
+        SERIAL_ECHO_SP(18);
354
+        SERIAL_ECHOPGM("TIMER0A");
355 355
         print_is_also_tied();
356 356
         timer_prefix(0, 'A', 3);
357 357
       #endif
@@ -372,7 +372,7 @@ static void pwm_details(uint8_t pin) {
372 372
   void print_port(int8_t pin) {   // print port number
373 373
     #ifdef digitalPinToPort_DEBUG
374 374
       uint8_t x;
375
-      SERIAL_PROTOCOLPGM("  Port: ");
375
+      SERIAL_ECHOPGM("  Port: ");
376 376
       #if AVR_AT90USB1286_FAMILY
377 377
         x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64;
378 378
       #else
@@ -395,7 +395,7 @@ static void pwm_details(uint8_t pin) {
395 395
       #endif
396 396
       SERIAL_CHAR(x);
397 397
     #else
398
-      SERIAL_PROTOCOL_SP(10);
398
+      SERIAL_ECHO_SP(10);
399 399
     #endif
400 400
   }
401 401
 

+ 1
- 2
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp Прегледај датотеку

@@ -62,8 +62,7 @@ void watchdog_init() {
62 62
 #if ENABLED(WATCHDOG_RESET_MANUAL)
63 63
   ISR(WDT_vect) {
64 64
     sei();  // With the interrupt driven serial we need to allow interrupts.
65
-    SERIAL_ERROR_START();
66
-    SERIAL_ERRORLNPGM(MSG_WATCHDOG_FIRED);
65
+    SERIAL_ERROR_MSG(MSG_WATCHDOG_FIRED);
67 66
     minkill();  // interrupt-safe final kill and infinite loop
68 67
   }
69 68
 #endif // WATCHDOG_RESET_MANUAL

+ 2
- 2
Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp Прегледај датотеку

@@ -121,7 +121,7 @@ static uint8_t buffer[256] = {0},   // The RAM buffer to accumulate writes
121 121
     char buffer[80];
122 122
 
123 123
     sprintf(buffer, "Page: %d (0x%04x)\n", page, page);
124
-    SERIAL_PROTOCOL(buffer);
124
+    SERIAL_ECHO(buffer);
125 125
 
126 126
     char* p = &buffer[0];
127 127
     for (int i = 0; i< PageSize; ++i) {
@@ -131,7 +131,7 @@ static uint8_t buffer[256] = {0},   // The RAM buffer to accumulate writes
131 131
       if ((i & 0xF) == 0xF) {
132 132
         *p++ = '\n';
133 133
         *p = 0;
134
-        SERIAL_PROTOCOL(buffer);
134
+        SERIAL_ECHO(buffer);
135 135
         p = &buffer[0];
136 136
       }
137 137
     }

+ 1
- 2
Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp Прегледај датотеку

@@ -53,8 +53,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
53 53
     if (v != eeprom_read_byte(p)) {
54 54
       eeprom_write_byte(p, v);
55 55
       if (eeprom_read_byte(p) != v) {
56
-        SERIAL_ECHO_START();
57
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
56
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
58 57
         return true;
59 58
       }
60 59
     }

+ 1
- 1
Marlin/src/HAL/HAL_DUE/pinsDebug.h Прегледај датотеку

@@ -93,7 +93,7 @@ bool GET_ARRAY_IS_DIGITAL(int8_t pin) {
93 93
 void pwm_details(int32_t pin) {
94 94
   if (pwm_status(pin)) {
95 95
     uint32_t chan = g_APinDescription[pin].ulPWMChannel;
96
-    SERIAL_PROTOCOLPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
96
+    SERIAL_ECHOPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
97 97
   }
98 98
 }
99 99
 

+ 2
- 2
Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp Прегледај датотеку

@@ -67,7 +67,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
67 67
   #ifdef DEBUG_MMC
68 68
     char buffer[80];
69 69
     sprintf(buffer, "SDRD: %d @ 0x%08x\n", nb_sector, addr);
70
-    SERIAL_PROTOCOL_P(0, buffer);
70
+    SERIAL_ECHO_P(0, buffer);
71 71
   #endif
72 72
 
73 73
   // Start reading
@@ -101,7 +101,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
101 101
   #ifdef DEBUG_MMC
102 102
     char buffer[80];
103 103
     sprintf(buffer, "SDWR: %d @ 0x%08x\n", nb_sector, addr);
104
-    SERIAL_PROTOCOL_P(0, buffer);
104
+    SERIAL_ECHO_P(0, buffer);
105 105
   #endif
106 106
 
107 107
   if (!card.getSd2Card().writeStart(addr, nb_sector))

+ 11
- 11
Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp Прегледај датотеку

@@ -80,23 +80,23 @@ bool PersistentStore::access_finish() {
80 80
 // to see errors that are happening in read_data / write_data
81 81
 static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) {
82 82
   PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
83
-  SERIAL_PROTOCOLCHAR(' ');
83
+  SERIAL_CHAR(' ');
84 84
   serialprintPGM(rw_str);
85
-  SERIAL_PROTOCOLPAIR("_data(", pos);
86
-  SERIAL_PROTOCOLPAIR(",", (int)value);
87
-  SERIAL_PROTOCOLPAIR(",", (int)size);
88
-  SERIAL_PROTOCOLLNPGM(", ...)");
85
+  SERIAL_ECHOPAIR("_data(", pos);
86
+  SERIAL_ECHOPAIR(",", (int)value);
87
+  SERIAL_ECHOPAIR(",", (int)size);
88
+  SERIAL_ECHOLNPGM(", ...)");
89 89
   if (total) {
90
-    SERIAL_PROTOCOLPGM(" f_");
90
+    SERIAL_ECHOPGM(" f_");
91 91
     serialprintPGM(rw_str);
92
-    SERIAL_PROTOCOLPAIR("()=", (int)s);
93
-    SERIAL_PROTOCOLPAIR("\n size=", size);
94
-    SERIAL_PROTOCOLPGM("\n bytes_");
92
+    SERIAL_ECHOPAIR("()=", (int)s);
93
+    SERIAL_ECHOPAIR("\n size=", size);
94
+    SERIAL_ECHOPGM("\n bytes_");
95 95
     serialprintPGM(write ? PSTR("written=") : PSTR("read="));
96
-    SERIAL_PROTOCOLLN(total);
96
+    SERIAL_ECHOLN(total);
97 97
   }
98 98
   else
99
-    SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s);
99
+    SERIAL_ECHOLNPAIR(" f_lseek()=", (int)s);
100 100
 }
101 101
 
102 102
 // File function return codes for type FRESULT. This goes away soon, but

+ 1
- 2
Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp Прегледај датотеку

@@ -62,8 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
62 62
       if (v != eeprom_read_byte(p)) {
63 63
         eeprom_write_byte(p, v);
64 64
         if (eeprom_read_byte(p) != v) {
65
-          SERIAL_ECHO_START();
66
-          SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
65
+          SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
67 66
           return true;
68 67
         }
69 68
       }

+ 1
- 2
Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp Прегледај датотеку

@@ -41,8 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
41 41
     if (v != eeprom_read_byte(p)) {
42 42
       eeprom_write_byte(p, v);
43 43
       if (eeprom_read_byte(p) != v) {
44
-        SERIAL_ECHO_START();
45
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
44
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
46 45
         return true;
47 46
       }
48 47
     }

+ 1
- 2
Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp Прегледај датотеку

@@ -41,8 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
41 41
     if (v != eeprom_read_byte(p)) {
42 42
       eeprom_write_byte(p, v);
43 43
       if (eeprom_read_byte(p) != v) {
44
-        SERIAL_ECHO_START();
45
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
44
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
46 45
         return true;
47 46
       }
48 47
     }

+ 1
- 2
Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp Прегледај датотеку

@@ -21,8 +21,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
21 21
     if (v != eeprom_read_byte(p)) {
22 22
       eeprom_write_byte(p, v);
23 23
       if (eeprom_read_byte(p) != v) {
24
-        SERIAL_ECHO_START();
25
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
24
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
26 25
         return true;
27 26
       }
28 27
     }

+ 1
- 2
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp Прегледај датотеку

@@ -42,8 +42,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
42 42
     if (v != eeprom_read_byte(p)) {
43 43
       eeprom_write_byte(p, v);
44 44
       if (eeprom_read_byte(p) != v) {
45
-        SERIAL_ECHO_START();
46
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
45
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
47 46
         return true;
48 47
       }
49 48
     }

+ 1
- 2
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp Прегледај датотеку

@@ -21,8 +21,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
21 21
     if (v != eeprom_read_byte(p)) {
22 22
       eeprom_write_byte(p, v);
23 23
       if (eeprom_read_byte(p) != v) {
24
-        SERIAL_ECHO_START();
25
-        SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
24
+        SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE);
26 25
         return true;
27 26
       }
28 27
     }

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h Прегледај датотеку

@@ -102,7 +102,7 @@ bool HAL_pwm_status(int8_t pin) {
102 102
     default:
103 103
       return false;
104 104
   }
105
-  SERIAL_PROTOCOLPGM("  ");
105
+  SERIAL_ECHOPGM("  ");
106 106
 }
107 107
 
108 108
 static void HAL_pwm_details(uint8_t pin) { /* TODO */ }

+ 1
- 2
Marlin/src/HAL/shared/backtrace/backtrace.cpp Прегледај датотеку

@@ -88,8 +88,7 @@ void backtrace(void) {
88 88
   btf.pc = pc | 1; // Force Thumb, as CORTEX only support it
89 89
 
90 90
   // Perform a backtrace
91
-  SERIAL_ERROR_START();
92
-  SERIAL_ERRORLNPGM("Backtrace:");
91
+  SERIAL_ERROR_MSG("Backtrace:");
93 92
   int ctr = 0;
94 93
   UnwindStart(&btf, &UnwCallbacks, &ctr);
95 94
 }

+ 6
- 11
Marlin/src/Marlin.cpp Прегледај датотеку

@@ -264,8 +264,7 @@ bool pin_is_protected(const pin_t pin) {
264 264
 }
265 265
 
266 266
 void protected_pin_err() {
267
-  SERIAL_ERROR_START();
268
-  SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN);
267
+  SERIAL_ERROR_MSG(MSG_ERR_PROTECTED_PIN);
269 268
 }
270 269
 
271 270
 void quickstop_stepper() {
@@ -400,8 +399,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
400 399
     // KILL the machine
401 400
     // ----------------------------------------------------------------
402 401
     if (killCount >= KILL_DELAY) {
403
-      SERIAL_ERROR_START();
404
-      SERIAL_ERRORLNPGM(MSG_KILL_BUTTON);
402
+      SERIAL_ERROR_MSG(MSG_KILL_BUTTON);
405 403
       kill();
406 404
     }
407 405
   #endif
@@ -606,8 +604,7 @@ void idle(
606 604
 void kill(PGM_P const lcd_msg/*=NULL*/) {
607 605
   thermalManager.disable_all_heaters();
608 606
 
609
-  SERIAL_ERROR_START();
610
-  SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
607
+  SERIAL_ERROR_MSG(MSG_ERR_KILLED);
611 608
 
612 609
   #if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI)
613 610
     ui.kill_screen(lcd_msg ? lcd_msg : PSTR(MSG_KILLED));
@@ -663,8 +660,7 @@ void stop() {
663 660
 
664 661
   if (IsRunning()) {
665 662
     Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
666
-    SERIAL_ERROR_START();
667
-    SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
663
+    SERIAL_ERROR_MSG(MSG_ERR_STOPPED);
668 664
     LCD_MESSAGEPGM(MSG_STOPPED);
669 665
     safe_delay(350);       // allow enough time for messages to get out before stopping
670 666
     Running = false;
@@ -745,7 +741,7 @@ void setup() {
745 741
     #endif
746 742
   #endif
747 743
 
748
-  SERIAL_PROTOCOLLNPGM("start");
744
+  SERIAL_ECHOLNPGM("start");
749 745
   SERIAL_ECHO_START();
750 746
 
751 747
   #if TMC_HAS_SPI
@@ -781,8 +777,7 @@ void setup() {
781 777
     SERIAL_ECHOPGM(MSG_CONFIGURATION_VER);
782 778
     SERIAL_ECHOPGM(STRING_DISTRIBUTION_DATE);
783 779
     SERIAL_ECHOLNPGM(MSG_AUTHOR STRING_CONFIG_H_AUTHOR);
784
-    SERIAL_ECHO_START();
785
-    SERIAL_ECHOLNPGM("Compiled: " __DATE__);
780
+    SERIAL_ECHO_MSG("Compiled: " __DATE__);
786 781
   #endif
787 782
 
788 783
   SERIAL_ECHO_START();

+ 18
- 18
Marlin/src/core/serial.cpp Прегледај датотеку

@@ -33,14 +33,14 @@ static const char echomagic[]  PROGMEM = "echo:";
33 33
     while (char ch = pgm_read_byte(str++)) SERIAL_CHAR_P(p, ch);
34 34
   }
35 35
 
36
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, const char *v)   { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
37
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, char v)          { serialprintPGM_P(p, s_P); SERIAL_CHAR_P(p, v); }
38
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, int v)           { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
39
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, long v)          { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
40
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, float v)         { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
41
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, double v)        { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
42
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned int v)  { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
43
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned long v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
36
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, const char *v)   { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
37
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, char v)          { serialprintPGM_P(p, s_P); SERIAL_CHAR_P(p, v); }
38
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, int v)           { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
39
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, long v)          { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
40
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, float v)         { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
41
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, double v)        { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
42
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned int v)  { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
43
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned long v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); }
44 44
 
45 45
   void serial_spaces_P(const int8_t p, uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR_P(p, ' '); }
46 46
 
@@ -56,14 +56,14 @@ void serialprintPGM(PGM_P str) {
56 56
 void serial_echo_start()  { serialprintPGM(echomagic); }
57 57
 void serial_error_start() { serialprintPGM(errormagic); }
58 58
 
59
-void serial_echopair_PGM(PGM_P s_P, const char *v)   { serialprintPGM(s_P); SERIAL_ECHO(v); }
60
-void serial_echopair_PGM(PGM_P s_P, char v)          { serialprintPGM(s_P); SERIAL_CHAR(v); }
61
-void serial_echopair_PGM(PGM_P s_P, int v)           { serialprintPGM(s_P); SERIAL_ECHO(v); }
62
-void serial_echopair_PGM(PGM_P s_P, long v)          { serialprintPGM(s_P); SERIAL_ECHO(v); }
63
-void serial_echopair_PGM(PGM_P s_P, float v)         { serialprintPGM(s_P); SERIAL_ECHO(v); }
64
-void serial_echopair_PGM(PGM_P s_P, double v)        { serialprintPGM(s_P); SERIAL_ECHO(v); }
65
-void serial_echopair_PGM(PGM_P s_P, unsigned int v)  { serialprintPGM(s_P); SERIAL_ECHO(v); }
66
-void serial_echopair_PGM(PGM_P s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
59
+void serial_echopair_PGM(PGM_P const s_P, const char *v)   { serialprintPGM(s_P); SERIAL_ECHO(v); }
60
+void serial_echopair_PGM(PGM_P const s_P, char v)          { serialprintPGM(s_P); SERIAL_CHAR(v); }
61
+void serial_echopair_PGM(PGM_P const s_P, int v)           { serialprintPGM(s_P); SERIAL_ECHO(v); }
62
+void serial_echopair_PGM(PGM_P const s_P, long v)          { serialprintPGM(s_P); SERIAL_ECHO(v); }
63
+void serial_echopair_PGM(PGM_P const s_P, float v)         { serialprintPGM(s_P); SERIAL_ECHO(v); }
64
+void serial_echopair_PGM(PGM_P const s_P, double v)        { serialprintPGM(s_P); SERIAL_ECHO(v); }
65
+void serial_echopair_PGM(PGM_P const s_P, unsigned int v)  { serialprintPGM(s_P); SERIAL_ECHO(v); }
66
+void serial_echopair_PGM(PGM_P const s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
67 67
 
68 68
 void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); }
69 69
 
@@ -74,7 +74,7 @@ void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EO
74 74
 
75 75
   #include "enum.h"
76 76
 
77
-  void print_xyz(PGM_P prefix, PGM_P suffix, const float x, const float y, const float z) {
77
+  void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) {
78 78
     serialprintPGM(prefix);
79 79
     SERIAL_CHAR('(');
80 80
     SERIAL_ECHO(x);
@@ -84,7 +84,7 @@ void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EO
84 84
     if (suffix) serialprintPGM(suffix); else SERIAL_EOL();
85 85
   }
86 86
 
87
-  void print_xyz(PGM_P prefix, PGM_P suffix, const float xyz[]) {
87
+  void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]) {
88 88
     print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]);
89 89
   }
90 90
 

+ 126
- 160
Marlin/src/core/serial.h Прегледај датотеку

@@ -48,193 +48,159 @@ extern uint8_t marlin_debug_flags;
48 48
 #endif
49 49
 
50 50
 #if NUM_SERIAL > 1
51
-  #define SERIAL_CHAR_P(p,x)                        (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.write(x) : MYSERIAL1.write(x)) : SERIAL_CHAR(x))
52
-  #define SERIAL_PROTOCOL_P(p,x)                    (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x) : MYSERIAL1.print(x)) : SERIAL_PROTOCOL(x))
53
-  #define SERIAL_PROTOCOL_F_P(p,x,y)                (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,y) : MYSERIAL1.print(x,y)) : SERIAL_PROTOCOL_F(x,y))
54
-  #define SERIAL_PROTOCOLLN_P(p,x)                  (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x) : MYSERIAL1.println(x)) : SERIAL_PROTOCOLLN(x))
55
-  #define SERIAL_PRINT_P(p,x,b)                     (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,b) : MYSERIAL1.print(x,b)) : SERIAL_PRINT(x,b))
56
-  #define SERIAL_PRINTLN_P(p,x,b)                   (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x,b) : MYSERIAL1.println(x,b)) : SERIAL_PRINTLN(x,b))
57
-  #define SERIAL_PRINTF_P(p,args...)                (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.printf(args) : MYSERIAL1.printf(args)) : SERIAL_PRINTF(args))
58
-
59
-  #define SERIAL_CHAR(x)                            (MYSERIAL0.write(x), MYSERIAL1.write(x))
60
-  #define SERIAL_PROTOCOL(x)                        (MYSERIAL0.print(x), MYSERIAL1.print(x))
61
-  #define SERIAL_PROTOCOL_F(x,y)                    (MYSERIAL0.print(x,y), MYSERIAL1.print(x,y))
62
-  #define SERIAL_PROTOCOLLN(x)                      (MYSERIAL0.println(x), MYSERIAL1.println(x))
63
-  #define SERIAL_PRINT(x,b)                         (MYSERIAL0.print(x,b), MYSERIAL1.print(x,b))
64
-  #define SERIAL_PRINTLN(x,b)                       (MYSERIAL0.println(x,b), MYSERIAL1.println(x,b))
65
-  #define SERIAL_PRINTF(args...)                    (MYSERIAL0.printf(args), MYSERIAL1.printf(args))
66
-
67
-  #define SERIAL_FLUSH_P(p)                         (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flush() : MYSERIAL1.flush()) : SERIAL_FLUSH())
68
-  #define SERIAL_FLUSH()                            (MYSERIAL0.flush(), MYSERIAL1.flush())
51
+
52
+  //
53
+  // Serial out to all ports
54
+  //
55
+  #define SERIAL_CHAR(x)                    (MYSERIAL0.write(x), MYSERIAL1.write(x))
56
+  #define SERIAL_ECHO(x)                    (MYSERIAL0.print(x), MYSERIAL1.print(x))
57
+  #define SERIAL_ECHO_F(x,y)                (MYSERIAL0.print(x,y), MYSERIAL1.print(x,y))
58
+  #define SERIAL_ECHOLN(x)                  (MYSERIAL0.println(x), MYSERIAL1.println(x))
59
+  #define SERIAL_PRINT(x,b)                 (MYSERIAL0.print(x,b), MYSERIAL1.print(x,b))
60
+  #define SERIAL_PRINTLN(x,b)               (MYSERIAL0.println(x,b), MYSERIAL1.println(x,b))
61
+  #define SERIAL_PRINTF(args...)            (MYSERIAL0.printf(args), MYSERIAL1.printf(args))
62
+  #define SERIAL_FLUSH()                    (MYSERIAL0.flush(), MYSERIAL1.flush())
63
+  #if TX_BUFFER_SIZE > 0
64
+    #define SERIAL_FLUSHTX()                (MYSERIAL0.flushTX(), MYSERIAL1.flushTX())
65
+  #endif
66
+
67
+  //
68
+  // Serial out with port redirect
69
+  //
70
+  #define SERIAL_CHAR_P(p,x)                (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.write(x) : MYSERIAL1.write(x)) : SERIAL_CHAR(x))
71
+  #define SERIAL_ECHO_P(p,x)                (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x) : MYSERIAL1.print(x)) : SERIAL_ECHO(x))
72
+  #define SERIAL_ECHO_F_P(p,x,y)            (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,y) : MYSERIAL1.print(x,y)) : SERIAL_ECHO_F(x,y))
73
+  #define SERIAL_ECHOLN_P(p,x)              (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x) : MYSERIAL1.println(x)) : SERIAL_ECHOLN(x))
74
+  #define SERIAL_PRINT_P(p,x,b)             (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,b) : MYSERIAL1.print(x,b)) : SERIAL_PRINT(x,b))
75
+  #define SERIAL_PRINTLN_P(p,x,b)           (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x,b) : MYSERIAL1.println(x,b)) : SERIAL_PRINTLN(x,b))
76
+  #define SERIAL_PRINTF_P(p,args...)        (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.printf(args) : MYSERIAL1.printf(args)) : SERIAL_PRINTF(args))
77
+  #define SERIAL_FLUSH_P(p)                 (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flush() : MYSERIAL1.flush()) : SERIAL_FLUSH())
69 78
   #if TX_BUFFER_SIZE > 0
70
-    #define SERIAL_FLUSHTX_P(p)                     (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flushTX() : MYSERIAL1.flushTX()) : SERIAL_FLUSHTX())
71
-    #define SERIAL_FLUSHTX()                        (MYSERIAL0.flushTX(), MYSERIAL1.flushTX())
79
+    #define SERIAL_FLUSHTX_P(p)             (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flushTX() : MYSERIAL1.flushTX()) : SERIAL_FLUSHTX())
72 80
   #endif
73 81
 
74
-  #define SERIAL_EOL_P(p) SERIAL_CHAR_P(p,'\n')
75
-
76
-  #define SERIAL_PROTOCOLCHAR_P(p,x)                SERIAL_CHAR_P(p,x)
77
-  #define SERIAL_PROTOCOLPGM_P(p,x)                 (serialprintPGM_P(p,PSTR(x)))
78
-  #define SERIAL_PROTOCOLLNPGM_P(p,x)               (serialprintPGM_P(p,PSTR(x "\n")))
79
-  #define SERIAL_PROTOCOLPAIR_P(p, pre, value)      (serial_echopair_PGM_P(p,PSTR(pre),(value)))
80
-  #define SERIAL_PROTOCOLLNPAIR_P(p, pre, value)    do{ SERIAL_PROTOCOLPAIR_P(p, pre, value); SERIAL_EOL_P(p); }while(0)
81
-
82
-  #define SERIAL_ECHO_START_P(p)                    serial_echo_start_P(p)
83
-  #define SERIAL_ECHO_P(p,x)                        SERIAL_PROTOCOL_P(p,x)
84
-  #define SERIAL_ECHOPGM_P(p,x)                     SERIAL_PROTOCOLPGM_P(p,x)
85
-  #define SERIAL_ECHOLN_P(p,x)                      SERIAL_PROTOCOLLN_P(p,x)
86
-  #define SERIAL_ECHOLNPGM_P(p,x)                   SERIAL_PROTOCOLLNPGM_P(p,x)
87
-  #define SERIAL_ECHOPAIR_P(p,pre,value)            SERIAL_PROTOCOLPAIR_P(p, pre, value)
88
-  #define SERIAL_ECHOLNPAIR_P(p,pre, value)         SERIAL_PROTOCOLLNPAIR_P(p, pre, value)
89
-  #define SERIAL_ECHO_F_P(p,x,y)                    SERIAL_PROTOCOL_F_P(p,x,y)
90
-
91
-  #define SERIAL_ERROR_START_P(p)                   serial_error_start_P(p)
92
-  #define SERIAL_ERROR_P(p,x)                       SERIAL_PROTOCOL_P(p,x)
93
-  #define SERIAL_ERRORPGM_P(p,x)                    SERIAL_PROTOCOLPGM_P(p,x)
94
-  #define SERIAL_ERRORLN_P(p,x)                     SERIAL_PROTOCOLLN_P(p,x)
95
-  #define SERIAL_ERRORLNPGM_P(p,x)                  SERIAL_PROTOCOLLNPGM_P(p,x)
96
-
97
-  // These macros compensate for float imprecision
98
-  #define SERIAL_PROTOCOLPAIR_F_P(p, pre, value)    SERIAL_PROTOCOLPAIR_P(p, pre, FIXFLOAT(value))
99
-  #define SERIAL_PROTOCOLLNPAIR_F_P(p, pre, value)  SERIAL_PROTOCOLLNPAIR_P(p, pre, FIXFLOAT(value))
100
-  #define SERIAL_ECHOPAIR_F_P(p,pre,value)          SERIAL_ECHOPAIR_P(p, pre, FIXFLOAT(value))
101
-  #define SERIAL_ECHOLNPAIR_F_P(p,pre, value)       SERIAL_ECHOLNPAIR_P(p, pre, FIXFLOAT(value))
102
-
103
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, const char *v);
104
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, char v);
105
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, int v);
106
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, long v);
107
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, float v);
108
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, double v);
109
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned int v);
110
-  void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned long v);
111
-  inline void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, uint8_t v) { serial_echopair_PGM_P(p, s_P, (int)v); }
112
-  inline void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, bool v)    { serial_echopair_PGM_P(p, s_P, (int)v); }
113
-  inline void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, void *v)   { serial_echopair_PGM_P(p, s_P, (unsigned long)v); }
82
+  #define SERIAL_ECHOPGM_P(p,x)             (serialprintPGM_P(p,PSTR(x)))
83
+  #define SERIAL_ECHOLNPGM_P(p,x)           (serialprintPGM_P(p,PSTR(x "\n")))
84
+  #define SERIAL_ECHOPAIR_P(p, pre, value)  (serial_echopair_PGM_P(p,PSTR(pre),(value)))
85
+
86
+  #define SERIAL_ECHO_START_P(p)            serial_echo_start_P(p)
87
+  #define SERIAL_ERROR_START_P(p)           serial_error_start_P(p)
88
+  #define SERIAL_EOL_P(p)                   SERIAL_CHAR_P(p,'\n')
89
+
90
+  #define SERIAL_ECHOPAIR_F_P(p, pre, value, y)   do{ SERIAL_ECHO_P(p, pre); SERIAL_ECHO_F_P(p, value, y); }while(0)
91
+  #define SERIAL_ECHOLNPAIR_F_P(p, pre, value, y) do{ SERIAL_ECHOPAIR_F_P(p, pre, value, y); SERIAL_EOL_P(p); }while(0)
92
+
93
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, const char *v);
94
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, char v);
95
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, int v);
96
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, long v);
97
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, float v);
98
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, double v);
99
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned int v);
100
+  void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned long v);
101
+  inline void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, uint8_t v) { serial_echopair_PGM_P(p, s_P, (int)v); }
102
+  inline void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, bool v)    { serial_echopair_PGM_P(p, s_P, (int)v); }
103
+  inline void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, void *v)   { serial_echopair_PGM_P(p, s_P, (unsigned long)v); }
114 104
 
115 105
   void serial_spaces_P(const int8_t p, uint8_t count);
116
-  #define SERIAL_ECHO_SP_P(p,C)                     serial_spaces_P(p,C)
117
-  #define SERIAL_ERROR_SP_P(p,C)                    serial_spaces_P(p,C)
118
-  #define SERIAL_PROTOCOL_SP_P(p,C)                 serial_spaces_P(p,C)
106
+  #define SERIAL_ECHO_SP_P(p,C)             serial_spaces_P(p,C)
119 107
 
120 108
   void serialprintPGM_P(const int8_t p, PGM_P str);
121 109
   void serial_echo_start_P(const int8_t p);
122 110
   void serial_error_start_P(const int8_t p);
123 111
 
124
-#else // NUM_SERIAL < 2
125
-
126
-  #define SERIAL_CHAR_P(p,x)                        SERIAL_CHAR(x)
127
-  #define SERIAL_PROTOCOL_P(p,x)                    SERIAL_PROTOCOL(x)
128
-  #define SERIAL_PROTOCOL_F_P(p,x,y)                SERIAL_PROTOCOL_F(x,y)
129
-  #define SERIAL_PROTOCOLLN_P(p,x)                  SERIAL_PROTOCOLLN(x)
130
-  #define SERIAL_PRINT_P(p,x,b)                     SERIAL_PRINT(x,b)
131
-  #define SERIAL_PRINTLN_P(p,x,b)                   SERIAL_PRINTLN(x,b)
132
-  #define SERIAL_PRINTF_P(p,args...)                SERIAL_PRINTF(args)
133
-
134
-  #define SERIAL_CHAR(x)                            MYSERIAL0.write(x)
135
-  #define SERIAL_PROTOCOL(x)                        MYSERIAL0.print(x)
136
-  #define SERIAL_PROTOCOL_F(x,y)                    MYSERIAL0.print(x,y)
137
-  #define SERIAL_PROTOCOLLN(x)                      MYSERIAL0.println(x)
138
-  #define SERIAL_PRINT(x,b)                         MYSERIAL0.print(x,b)
139
-  #define SERIAL_PRINTLN(x,b)                       MYSERIAL0.println(x,b)
140
-  #define SERIAL_PRINTF(args...)                    MYSERIAL0.printf(args)
141
-
142
-  #define SERIAL_FLUSH_P(p)                         SERIAL_FLUSH()
143
-  #define SERIAL_FLUSH()                            MYSERIAL0.flush()
112
+#else // NUM_SERIAL <= 1
113
+
114
+  //
115
+  // Serial out to all ports
116
+  //
117
+  #define SERIAL_CHAR(x)                    MYSERIAL0.write(x)
118
+  #define SERIAL_ECHO(x)                    MYSERIAL0.print(x)
119
+  #define SERIAL_ECHO_F(x,y)                MYSERIAL0.print(x,y)
120
+  #define SERIAL_ECHOLN(x)                  MYSERIAL0.println(x)
121
+  #define SERIAL_PRINT(x,b)                 MYSERIAL0.print(x,b)
122
+  #define SERIAL_PRINTLN(x,b)               MYSERIAL0.println(x,b)
123
+  #define SERIAL_PRINTF(args...)            MYSERIAL0.printf(args)
124
+  #define SERIAL_FLUSH()                    MYSERIAL0.flush()
144 125
   #if TX_BUFFER_SIZE > 0
145
-    #define SERIAL_FLUSHTX_P(p)                     SERIAL_FLUSHTX()
146
-    #define SERIAL_FLUSHTX()                        MYSERIAL0.flushTX()
126
+    #define SERIAL_FLUSHTX()                MYSERIAL0.flushTX()
147 127
   #endif
148 128
 
149
-  #define SERIAL_EOL_P(p) SERIAL_EOL()
129
+  //
130
+  // Serial out with port redirect
131
+  //
132
+  #define SERIAL_CHAR_P(p,x)                SERIAL_CHAR(x)
133
+  #define SERIAL_ECHO_P(p,x)                SERIAL_ECHO(x)
134
+  #define SERIAL_ECHO_F_P(p,x,y)            SERIAL_ECHO_F(x,y)
135
+  #define SERIAL_ECHOLN_P(p,x)              SERIAL_ECHOLN(x)
136
+  #define SERIAL_PRINT_P(p,x,b)             SERIAL_PRINT(x,b)
137
+  #define SERIAL_PRINTLN_P(p,x,b)           SERIAL_PRINTLN(x,b)
138
+  #define SERIAL_PRINTF_P(p,args...)        SERIAL_PRINTF(args)
139
+  #define SERIAL_FLUSH_P(p)                 SERIAL_FLUSH()
140
+  #if TX_BUFFER_SIZE > 0
141
+    #define SERIAL_FLUSHTX_P(p)             SERIAL_FLUSHTX()
142
+  #endif
150 143
 
151
-  #define SERIAL_PROTOCOLCHAR_P(p,x)                SERIAL_PROTOCOLCHAR(x)
152
-  #define SERIAL_PROTOCOLPGM_P(p,x)                 SERIAL_PROTOCOLPGM(x)
153
-  #define SERIAL_PROTOCOLLNPGM_P(p,x)               SERIAL_PROTOCOLLNPGM(x)
154
-  #define SERIAL_PROTOCOLPAIR_P(p, pre, value)      SERIAL_PROTOCOLPAIR(pre, value)
155
-  #define SERIAL_PROTOCOLLNPAIR_P(p, pre, value)    SERIAL_PROTOCOLLNPAIR(pre, value)
144
+  #define SERIAL_ECHOPGM_P(p,x)             SERIAL_ECHOPGM(x)
145
+  #define SERIAL_ECHOLNPGM_P(p,x)           SERIAL_ECHOLNPGM(x)
146
+  #define SERIAL_ECHOPAIR_P(p, pre, value)  SERIAL_ECHOPAIR(pre, value)
156 147
 
157
-  #define SERIAL_ECHO_START_P(p)                    SERIAL_ECHO_START()
158
-  #define SERIAL_ECHO_P(p,x)                        SERIAL_ECHO(x)
159
-  #define SERIAL_ECHOPGM_P(p,x)                     SERIAL_ECHOPGM(x)
160
-  #define SERIAL_ECHOLN_P(p,x)                      SERIAL_ECHOLN(x)
161
-  #define SERIAL_ECHOLNPGM_P(p,x)                   SERIAL_ECHOLNPGM(x)
162
-  #define SERIAL_ECHOPAIR_P(p,pre,value)            SERIAL_ECHOPAIR(pre, value)
163
-  #define SERIAL_ECHOLNPAIR_P(p,pre, value)         SERIAL_ECHOLNPAIR(pre, value)
164
-  #define SERIAL_ECHO_F_P(p,x,y)                    SERIAL_ECHO_F(x,y)
148
+  #define SERIAL_ECHO_P(p,x)                SERIAL_ECHO(x)
149
+  #define SERIAL_ECHOLN_P(p,x)              SERIAL_ECHOLN(x)
165 150
 
166
-  #define SERIAL_ERROR_START_P(p)                   SERIAL_ERROR_START()
167
-  #define SERIAL_ERROR_P(p,x)                       SERIAL_ERROR(x)
168
-  #define SERIAL_ERRORPGM_P(p,x)                    SERIAL_ERRORPGM(x)
169
-  #define SERIAL_ERRORLN_P(p,x)                     SERIAL_ERRORLN(x)
170
-  #define SERIAL_ERRORLNPGM_P(p,x)                  SERIAL_ERRORLNPGM(x)
151
+  #define SERIAL_ECHO_START_P(p)            SERIAL_ECHO_START()
152
+  #define SERIAL_ERROR_START_P(p)           SERIAL_ERROR_START()
153
+  #define SERIAL_EOL_P(p)                   SERIAL_EOL()
171 154
 
172
-  // These macros compensate for float imprecision
173
-  #define SERIAL_PROTOCOLPAIR_F_P(p, pre, value)    SERIAL_PROTOCOLPAIR_F(pre, value)
174
-  #define SERIAL_PROTOCOLLNPAIR_F_P(p, pre, value)  SERIAL_PROTOCOLLNPAIR_F(pre, value)
175
-  #define SERIAL_ECHOPAIR_F_P(p,pre,value)          SERIAL_ECHOPAIR_F(pre, value)
176
-  #define SERIAL_ECHOLNPAIR_F_P(p,pre, value)       SERIAL_ECHOLNPAIR_F(pre, value)
155
+  #define SERIAL_ECHOPAIR_F_P(p, pre, value, y)   SERIAL_ECHOPAIR_F(pre, value, y)
156
+  #define SERIAL_ECHOLNPAIR_F_P(p, pre, value, y) SERIAL_ECHOLNPAIR_F(pre, value, y)
177 157
 
178
-  #define serial_echopair_PGM_P(p,s_P,v)            serial_echopair_PGM(s_P, v)
158
+  #define serial_echopair_PGM_P(p,s_P,v)    serial_echopair_PGM(s_P, v)
179 159
 
180
-  #define serial_spaces_P(p,c)                      serial_spaces(c)
181
-  #define SERIAL_ECHO_SP_P(p,C)                     SERIAL_ECHO_SP(C)
182
-  #define SERIAL_ERROR_SP_P(p,C)                    SERIAL_ERROR_SP(C)
183
-  #define SERIAL_PROTOCOL_SP_P(p,C)                 SERIAL_PROTOCOL_SP(C)
160
+  #define serial_spaces_P(p,c)              serial_spaces(c)
161
+  #define SERIAL_ECHO_SP_P(p,C)             SERIAL_ECHO_SP(C)
184 162
 
185
-  #define serialprintPGM_P(p,s)                     serialprintPGM(s)
163
+  #define serialprintPGM_P(p,s)             serialprintPGM(s)
186 164
 
187 165
 #endif // NUM_SERIAL < 2
188 166
 
189
-#define SERIAL_EOL() SERIAL_CHAR('\n')
190
-
191
-#define SERIAL_PROTOCOLCHAR(x)                      SERIAL_CHAR(x)
192
-#define SERIAL_PROTOCOLPGM(x)                       (serialprintPGM(PSTR(x)))
193
-#define SERIAL_PROTOCOLLNPGM(x)                     (serialprintPGM(PSTR(x "\n")))
194
-#define SERIAL_PROTOCOLPAIR(pre, value)             (serial_echopair_PGM(PSTR(pre), value))
195
-#define SERIAL_PROTOCOLLNPAIR(pre, value)           do { SERIAL_PROTOCOLPAIR(pre, value); SERIAL_EOL(); } while(0)
196
-
197
-#define SERIAL_ECHO_START()                         serial_echo_start()
198
-#define SERIAL_ECHO(x)                              SERIAL_PROTOCOL(x)
199
-#define SERIAL_ECHOPGM(x)                           SERIAL_PROTOCOLPGM(x)
200
-#define SERIAL_ECHOLN(x)                            SERIAL_PROTOCOLLN(x)
201
-#define SERIAL_ECHOLNPGM(x)                         SERIAL_PROTOCOLLNPGM(x)
202
-#define SERIAL_ECHOPAIR(pre,value)                  SERIAL_PROTOCOLPAIR(pre, value)
203
-#define SERIAL_ECHOLNPAIR(pre, value)               SERIAL_PROTOCOLLNPAIR(pre, value)
204
-#define SERIAL_ECHO_F(x,y)                          SERIAL_PROTOCOL_F(x, y)
205
-
206
-#define SERIAL_ERROR_START()                        serial_error_start()
207
-#define SERIAL_ERROR(x)                             SERIAL_PROTOCOL(x)
208
-#define SERIAL_ERRORPGM(x)                          SERIAL_PROTOCOLPGM(x)
209
-#define SERIAL_ERRORLN(x)                           SERIAL_PROTOCOLLN(x)
210
-#define SERIAL_ERRORLNPGM(x)                        SERIAL_PROTOCOLLNPGM(x)
211
-
212
-// These macros compensate for float imprecision
213
-#define SERIAL_PROTOCOLPAIR_F(pre, value)           SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value))
214
-#define SERIAL_PROTOCOLLNPAIR_F(pre, value)         SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value))
215
-#define SERIAL_ECHOPAIR_F(pre,value)                SERIAL_ECHOPAIR(pre, FIXFLOAT(value))
216
-#define SERIAL_ECHOLNPAIR_F(pre, value)             SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value))
217
-
218
-void serial_echopair_PGM(PGM_P s_P, const char *v);
219
-void serial_echopair_PGM(PGM_P s_P, char v);
220
-void serial_echopair_PGM(PGM_P s_P, int v);
221
-void serial_echopair_PGM(PGM_P s_P, long v);
222
-void serial_echopair_PGM(PGM_P s_P, float v);
223
-void serial_echopair_PGM(PGM_P s_P, double v);
224
-void serial_echopair_PGM(PGM_P s_P, unsigned int v);
225
-void serial_echopair_PGM(PGM_P s_P, unsigned long v);
226
-inline void serial_echopair_PGM(PGM_P s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); }
227
-inline void serial_echopair_PGM(PGM_P s_P, bool v)    { serial_echopair_PGM(s_P, (int)v); }
228
-inline void serial_echopair_PGM(PGM_P s_P, void *v)   { serial_echopair_PGM(s_P, (unsigned long)v); }
167
+#define SERIAL_ECHOPGM(x)                   (serialprintPGM(PSTR(x)))
168
+#define SERIAL_ECHOLNPGM(x)                 (serialprintPGM(PSTR(x "\n")))
169
+#define SERIAL_ECHOPAIR(pre, value)         (serial_echopair_PGM(PSTR(pre), value))
170
+#define SERIAL_ECHOLNPAIR(pre, value)       do { SERIAL_ECHOPAIR(pre, value); SERIAL_EOL(); } while(0)
171
+
172
+#define SERIAL_ECHOPAIR_F(pre, value, y)    do{ SERIAL_ECHO(pre); SERIAL_ECHO_F(value, y); }while(0)
173
+#define SERIAL_ECHOLNPAIR_F(pre, value, y)  do{ SERIAL_ECHOPAIR_F(pre, value, y); SERIAL_EOL(); }while(0)
174
+
175
+#define SERIAL_ECHO_START()                 serial_echo_start()
176
+#define SERIAL_ERROR_START()                serial_error_start()
177
+#define SERIAL_EOL()                        SERIAL_CHAR('\n')
178
+
179
+#define SERIAL_ECHO_MSG(STR)                do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0)
180
+#define SERIAL_ECHO_MSG_P(p, STR)           do{ SERIAL_ECHO_START_P(p); SERIAL_ECHOLNPGM_P(p, STR); }while(0)
181
+#define SERIAL_ERROR_MSG(STR)               do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(STR); }while(0)
182
+#define SERIAL_ERROR_MSG_P(p, STR)          do{ SERIAL_ERROR_START_P(p); SERIAL_ECHOLNPGM_P(p, STR); }while(0)
183
+
184
+#define SERIAL_ECHOLNPAIR_P(p, pre, value)  do{ SERIAL_ECHOPAIR_P(p, pre, value); SERIAL_EOL_P(p); }while(0)
229 185
 
230 186
 void serial_spaces(uint8_t count);
231
-#define SERIAL_ECHO_SP(C)                           serial_spaces(C)
232
-#define SERIAL_ERROR_SP(C)                          serial_spaces(C)
233
-#define SERIAL_PROTOCOL_SP(C)                       serial_spaces(C)
187
+#define SERIAL_ECHO_SP(C)                   serial_spaces(C)
234 188
 
235 189
 //
236 190
 // Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
237 191
 //
192
+void serial_echopair_PGM(PGM_P const s_P, const char *v);
193
+void serial_echopair_PGM(PGM_P const s_P, char v);
194
+void serial_echopair_PGM(PGM_P const s_P, int v);
195
+void serial_echopair_PGM(PGM_P const s_P, long v);
196
+void serial_echopair_PGM(PGM_P const s_P, float v);
197
+void serial_echopair_PGM(PGM_P const s_P, double v);
198
+void serial_echopair_PGM(PGM_P const s_P, unsigned int v);
199
+void serial_echopair_PGM(PGM_P const s_P, unsigned long v);
200
+inline void serial_echopair_PGM(PGM_P const s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); }
201
+inline void serial_echopair_PGM(PGM_P const s_P, bool v)    { serial_echopair_PGM(s_P, (int)v); }
202
+inline void serial_echopair_PGM(PGM_P const s_P, void *v)   { serial_echopair_PGM(s_P, (unsigned long)v); }
203
+
238 204
 void serialprintPGM(PGM_P str);
239 205
 void serial_echo_start();
240 206
 void serial_error_start();
@@ -242,7 +208,7 @@ void serialprint_onoff(const bool onoff);
242 208
 void serialprintln_onoff(const bool onoff);
243 209
 
244 210
 #if ENABLED(DEBUG_LEVELING_FEATURE)
245
-  void print_xyz(PGM_P prefix, PGM_P suffix, const float x, const float y, const float z);
246
-  void print_xyz(PGM_P prefix, PGM_P suffix, const float xyz[]);
211
+  void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z);
212
+  void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]);
247 213
   #define DEBUG_POS(SUFFIX,VAR) do { print_xyz(PSTR("  " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
248 214
 #endif

+ 17
- 28
Marlin/src/feature/I2CPositionEncoder.cpp Прегледај датотеку

@@ -66,8 +66,7 @@ void I2CPositionEncoder::update() {
66 66
     /*
67 67
     if (trusted) { //commented out as part of the note below
68 68
       trusted = false;
69
-      SERIAL_ECHOPGM("Fault detected on ");
70
-      SERIAL_ECHO(axis_codes[encoderAxis]);
69
+      SERIAL_ECHOPAIR("Fault detected on ", axis_codes[encoderAxis]);
71 70
       SERIAL_ECHOLNPGM(" axis encoder. Disengaging error correction until module is trusted again.");
72 71
     }
73 72
     */
@@ -93,8 +92,7 @@ void I2CPositionEncoder::update() {
93 92
       if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) {
94 93
         trusted = true;
95 94
 
96
-        SERIAL_ECHOPGM("Untrusted encoder module on ");
97
-        SERIAL_ECHO(axis_codes[encoderAxis]);
95
+        SERIAL_ECHOPAIR("Untrusted encoder module on ", axis_codes[encoderAxis]);
98 96
         SERIAL_ECHOLNPGM(" axis has been fault-free for set duration, reinstating error correction.");
99 97
 
100 98
         //the encoder likely lost its place when the error occured, so we'll reset and use the printer's
@@ -106,17 +104,10 @@ void I2CPositionEncoder::update() {
106 104
         zeroOffset -= (positionInTicks - get_position());
107 105
 
108 106
         #ifdef I2CPE_DEBUG
109
-          SERIAL_ECHOPGM("Current position is ");
110
-          SERIAL_ECHOLN(pos);
111
-
112
-          SERIAL_ECHOPGM("Position in encoder ticks is ");
113
-          SERIAL_ECHOLN(positionInTicks);
114
-
115
-          SERIAL_ECHOPGM("New zero-offset of ");
116
-          SERIAL_ECHOLN(zeroOffset);
117
-
118
-          SERIAL_ECHOPGM("New position reads as ");
119
-          SERIAL_ECHO(get_position());
107
+          SERIAL_ECHOLNPAIR("Current position is ", pos);
108
+          SERIAL_ECHOLNPAIR("Position in encoder ticks is ", positionInTicks);
109
+          SERIAL_ECHOLNPAIR("New zero-offset of ", zeroOffset);
110
+          SERIAL_ECHOPAIR("New position reads as ", get_position());
120 111
           SERIAL_CHAR('(');
121 112
           SERIAL_ECHO(mm_from_count(get_position()));
122 113
           SERIAL_ECHOLNPGM(")");
@@ -159,14 +150,12 @@ void I2CPositionEncoder::update() {
159 150
       const int32_t error = get_axis_error_steps(false);
160 151
     #endif
161 152
 
162
-    //SERIAL_ECHOPGM("Axis error steps: ");
163
-    //SERIAL_ECHOLN(error);
153
+    //SERIAL_ECHOLNPAIR("Axis error steps: ", error);
164 154
 
165 155
     #ifdef I2CPE_ERR_THRESH_ABORT
166 156
       if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) {
167 157
         //kill(PSTR("Significant Error"));
168
-        SERIAL_ECHOPGM("Axis error greater than set threshold, aborting!");
169
-        SERIAL_ECHOLN(error);
158
+        SERIAL_ECHOLNPAIR("Axis error greater than set threshold, aborting!", error);
170 159
         safe_delay(5000);
171 160
       }
172 161
     #endif
@@ -800,33 +789,33 @@ int8_t I2CPositionEncodersMgr::parse() {
800 789
   if (parser.seen('A')) {
801 790
 
802 791
     if (!parser.has_value()) {
803
-      SERIAL_PROTOCOLLNPGM("?A seen, but no address specified! [30-200]");
792
+      SERIAL_ECHOLNPGM("?A seen, but no address specified! [30-200]");
804 793
       return I2CPE_PARSE_ERR;
805 794
     };
806 795
 
807 796
     I2CPE_addr = parser.value_byte();
808 797
     if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55
809
-      SERIAL_PROTOCOLLNPGM("?Address out of range. [30-200]");
798
+      SERIAL_ECHOLNPGM("?Address out of range. [30-200]");
810 799
       return I2CPE_PARSE_ERR;
811 800
     }
812 801
 
813 802
     I2CPE_idx = idx_from_addr(I2CPE_addr);
814 803
     if (I2CPE_idx >= I2CPE_ENCODER_CNT) {
815
-      SERIAL_PROTOCOLLNPGM("?No device with this address!");
804
+      SERIAL_ECHOLNPGM("?No device with this address!");
816 805
       return I2CPE_PARSE_ERR;
817 806
     }
818 807
   }
819 808
   else if (parser.seenval('I')) {
820 809
 
821 810
     if (!parser.has_value()) {
822
-      SERIAL_PROTOCOLLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1);
823
-      SERIAL_PROTOCOLLNPGM("]");
811
+      SERIAL_ECHOLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1);
812
+      SERIAL_ECHOLNPGM("]");
824 813
       return I2CPE_PARSE_ERR;
825 814
     };
826 815
 
827 816
     I2CPE_idx = parser.value_byte();
828 817
     if (I2CPE_idx >= I2CPE_ENCODER_CNT) {
829
-      SERIAL_PROTOCOLLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1);
818
+      SERIAL_ECHOLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1);
830 819
       SERIAL_ECHOLNPGM("]");
831 820
       return I2CPE_PARSE_ERR;
832 821
     }
@@ -984,18 +973,18 @@ void I2CPositionEncodersMgr::M864() {
984 973
 
985 974
   if (parser.seen('S')) {
986 975
     if (!parser.has_value()) {
987
-      SERIAL_PROTOCOLLNPGM("?S seen, but no address specified! [30-200]");
976
+      SERIAL_ECHOLNPGM("?S seen, but no address specified! [30-200]");
988 977
       return;
989 978
     };
990 979
 
991 980
     newAddress = parser.value_byte();
992 981
     if (!WITHIN(newAddress, 30, 200)) {
993
-      SERIAL_PROTOCOLLNPGM("?New address out of range. [30-200]");
982
+      SERIAL_ECHOLNPGM("?New address out of range. [30-200]");
994 983
       return;
995 984
     }
996 985
   }
997 986
   else if (!I2CPE_anyaxis) {
998
-    SERIAL_PROTOCOLLNPGM("?You must specify S or [XYZE].");
987
+    SERIAL_ECHOLNPGM("?You must specify S or [XYZE].");
999 988
     return;
1000 989
   }
1001 990
   else {

+ 2
- 2
Marlin/src/feature/I2CPositionEncoder.h Прегледај датотеку

@@ -288,7 +288,7 @@ class I2CPositionEncodersMgr {
288 288
       CHECK_IDX();
289 289
       encoders[idx].set_ec_threshold(newThreshold);
290 290
       SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]);
291
-      SERIAL_ECHOPAIR_F(" axis set to ", newThreshold);
291
+      SERIAL_ECHOPAIR(" axis set to ", FIXFLOAT(newThreshold));
292 292
       SERIAL_ECHOLNPGM("mm.");
293 293
     }
294 294
 
@@ -296,7 +296,7 @@ class I2CPositionEncodersMgr {
296 296
       CHECK_IDX();
297 297
       const float threshold = encoders[idx].get_ec_threshold();
298 298
       SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]);
299
-      SERIAL_ECHOPAIR_F(" axis is ", threshold);
299
+      SERIAL_ECHOPAIR(" axis is ", FIXFLOAT(threshold));
300 300
       SERIAL_ECHOLNPGM("mm.");
301 301
     }
302 302
 

+ 16
- 16
Marlin/src/feature/bedlevel/bedlevel.cpp Прегледај датотеку

@@ -160,50 +160,50 @@ void reset_bed_level() {
160 160
     #ifndef SCAD_MESH_OUTPUT
161 161
       for (uint8_t x = 0; x < sx; x++) {
162 162
         serial_spaces(precision + (x < 10 ? 3 : 2));
163
-        SERIAL_PROTOCOL(int(x));
163
+        SERIAL_ECHO(int(x));
164 164
       }
165 165
       SERIAL_EOL();
166 166
     #endif
167 167
     #ifdef SCAD_MESH_OUTPUT
168
-      SERIAL_PROTOCOLLNPGM("measured_z = ["); // open 2D array
168
+      SERIAL_ECHOLNPGM("measured_z = ["); // open 2D array
169 169
     #endif
170 170
     for (uint8_t y = 0; y < sy; y++) {
171 171
       #ifdef SCAD_MESH_OUTPUT
172
-        SERIAL_PROTOCOLPGM(" [");           // open sub-array
172
+        SERIAL_ECHOPGM(" [");           // open sub-array
173 173
       #else
174
-        if (y < 10) SERIAL_PROTOCOLCHAR(' ');
175
-        SERIAL_PROTOCOL(int(y));
174
+        if (y < 10) SERIAL_CHAR(' ');
175
+        SERIAL_ECHO(int(y));
176 176
       #endif
177 177
       for (uint8_t x = 0; x < sx; x++) {
178
-        SERIAL_PROTOCOLCHAR(' ');
178
+        SERIAL_CHAR(' ');
179 179
         const float offset = fn(x, y);
180 180
         if (!isnan(offset)) {
181
-          if (offset >= 0) SERIAL_PROTOCOLCHAR('+');
182
-          SERIAL_PROTOCOL_F(offset, int(precision));
181
+          if (offset >= 0) SERIAL_CHAR('+');
182
+          SERIAL_ECHO_F(offset, int(precision));
183 183
         }
184 184
         else {
185 185
           #ifdef SCAD_MESH_OUTPUT
186 186
             for (uint8_t i = 3; i < precision + 3; i++)
187
-              SERIAL_PROTOCOLCHAR(' ');
188
-            SERIAL_PROTOCOLPGM("NAN");
187
+              SERIAL_CHAR(' ');
188
+            SERIAL_ECHOPGM("NAN");
189 189
           #else
190 190
             for (uint8_t i = 0; i < precision + 3; i++)
191
-              SERIAL_PROTOCOLCHAR(i ? '=' : ' ');
191
+              SERIAL_CHAR(i ? '=' : ' ');
192 192
           #endif
193 193
         }
194 194
         #ifdef SCAD_MESH_OUTPUT
195
-          if (x < sx - 1) SERIAL_PROTOCOLCHAR(',');
195
+          if (x < sx - 1) SERIAL_CHAR(',');
196 196
         #endif
197 197
       }
198 198
       #ifdef SCAD_MESH_OUTPUT
199
-        SERIAL_PROTOCOLCHAR(' ');
200
-        SERIAL_PROTOCOLCHAR(']');                     // close sub-array
201
-        if (y < sy - 1) SERIAL_PROTOCOLCHAR(',');
199
+        SERIAL_CHAR(' ');
200
+        SERIAL_CHAR(']');                     // close sub-array
201
+        if (y < sy - 1) SERIAL_CHAR(',');
202 202
       #endif
203 203
       SERIAL_EOL();
204 204
     }
205 205
     #ifdef SCAD_MESH_OUTPUT
206
-      SERIAL_PROTOCOLPGM("];");                       // close 2D array
206
+      SERIAL_ECHOPGM("];");                       // close 2D array
207 207
     #endif
208 208
     SERIAL_EOL();
209 209
   }

+ 2
- 3
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp Прегледај датотеку

@@ -119,9 +119,8 @@
119 119
   #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES
120 120
 
121 121
   void mesh_bed_leveling::report_mesh() {
122
-    SERIAL_PROTOCOLPGM(STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh. Z offset: ");
123
-    SERIAL_PROTOCOL_F(z_offset, 5);
124
-    SERIAL_PROTOCOLLNPGM("\nMeasured points:");
122
+    SERIAL_ECHOPAIR_F(STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh. Z offset: ", z_offset, 5);
123
+    SERIAL_ECHOLNPGM("\nMeasured points:");
125 124
     print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5,
126 125
       [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; }
127 126
     );

+ 17
- 19
Marlin/src/feature/bedlevel/ubl/ubl.cpp Прегледај датотеку

@@ -39,7 +39,7 @@
39 39
       const int8_t port/*= -1*/
40 40
     #endif
41 41
   ) {
42
-    SERIAL_PROTOCOLPGM_P(port, "Unified Bed Leveling");
42
+    SERIAL_ECHOPGM_P(port, "Unified Bed Leveling");
43 43
   }
44 44
 
45 45
   void unified_bed_leveling::report_current_mesh(
@@ -48,16 +48,14 @@
48 48
     #endif
49 49
   ) {
50 50
     if (!leveling_is_valid()) return;
51
-    SERIAL_ECHO_START_P(port);
52
-    SERIAL_ECHOLNPGM_P(port, "  G29 I99");
51
+    SERIAL_ECHO_MSG_P(port, "  G29 I99");
53 52
     for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
54 53
       for (uint8_t y = 0;  y < GRID_MAX_POINTS_Y; y++)
55 54
         if (!isnan(z_values[x][y])) {
56 55
           SERIAL_ECHO_START_P(port);
57 56
           SERIAL_ECHOPAIR_P(port, "  M421 I", x);
58 57
           SERIAL_ECHOPAIR_P(port, " J", y);
59
-          SERIAL_ECHOPGM_P(port, " Z");
60
-          SERIAL_ECHO_F_P(port, z_values[x][y], 2);
58
+          SERIAL_ECHOPAIR_F_P(port, " Z", z_values[x][y], 2);
61 59
           SERIAL_EOL_P(port);
62 60
           serial_delay(75); // Prevent Printrun from exploding
63 61
         }
@@ -73,9 +71,9 @@
73 71
         port
74 72
       #endif
75 73
     );
76
-    SERIAL_PROTOCOLPGM_P(port, " System v" UBL_VERSION " ");
77
-    if (!planner.leveling_active) SERIAL_PROTOCOLPGM_P(port, "in");
78
-    SERIAL_PROTOCOLLNPGM_P(port, "active.");
74
+    SERIAL_ECHOPGM_P(port, " System v" UBL_VERSION " ");
75
+    if (!planner.leveling_active) SERIAL_ECHOPGM_P(port, "in");
76
+    SERIAL_ECHOLNPGM_P(port, "active.");
79 77
     serial_delay(50);
80 78
   }
81 79
 
@@ -105,16 +103,16 @@
105 103
       if (xy_dist == 0.0) return;
106 104
 
107 105
       const float fpmm = de / xy_dist;
108
-      SERIAL_ECHOPGM("   fpmm="); SERIAL_ECHO_F(fpmm, 6);
109
-      SERIAL_ECHOPGM("    current=( ");
110
-      SERIAL_ECHO_F(current_position[X_AXIS], 6); SERIAL_ECHOPGM(", ");
111
-      SERIAL_ECHO_F(current_position[Y_AXIS], 6); SERIAL_ECHOPGM(", ");
112
-      SERIAL_ECHO_F(current_position[Z_AXIS], 6); SERIAL_ECHOPGM(", ");
113
-      SERIAL_ECHO_F(current_position[E_AXIS], 6); SERIAL_ECHOPGM(" )   destination=( ");
114
-      debug_echo_axis(X_AXIS); SERIAL_ECHOPGM(", ");
115
-      debug_echo_axis(Y_AXIS); SERIAL_ECHOPGM(", ");
116
-      debug_echo_axis(Z_AXIS); SERIAL_ECHOPGM(", ");
117
-      debug_echo_axis(E_AXIS); SERIAL_ECHOPGM(" )   ");
106
+      SERIAL_ECHOPAIR_F("   fpmm=", fpmm, 6);
107
+      SERIAL_ECHOPAIR_F("    current=( ", current_position[X_AXIS], 6);
108
+      SERIAL_ECHOPAIR_F(", ", current_position[Y_AXIS], 6);
109
+      SERIAL_ECHOPAIR_F(", ", current_position[Z_AXIS], 6);
110
+      SERIAL_ECHOPAIR_F(", ", current_position[E_AXIS], 6);
111
+      SERIAL_ECHOPGM(" )   destination=( "); debug_echo_axis(X_AXIS);
112
+      SERIAL_ECHOPGM(", "); debug_echo_axis(Y_AXIS);
113
+      SERIAL_ECHOPGM(", "); debug_echo_axis(Z_AXIS);
114
+      SERIAL_ECHOPGM(", "); debug_echo_axis(E_AXIS);
115
+      SERIAL_ECHOPGM(" )   ");
118 116
       serialprintPGM(title);
119 117
       SERIAL_EOL();
120 118
     }
@@ -279,7 +277,7 @@
279 277
     uint8_t error_flag = 0;
280 278
 
281 279
     if (settings.calc_num_meshes() < 1) {
282
-      SERIAL_PROTOCOLLNPGM("?Mesh too big for EEPROM.");
280
+      SERIAL_ECHOLNPGM("?Mesh too big for EEPROM.");
283 281
       error_flag++;
284 282
     }
285 283
 

+ 3
- 9
Marlin/src/feature/bedlevel/ubl/ubl.h Прегледај датотеку

@@ -308,19 +308,13 @@ class unified_bed_leveling {
308 308
       #if ENABLED(DEBUG_LEVELING_FEATURE)
309 309
         if (DEBUGGING(MESH_ADJUST)) {
310 310
           SERIAL_ECHOPAIR(" raw get_z_correction(", rx0);
311
-          SERIAL_CHAR(',');
312
-          SERIAL_ECHO(ry0);
313
-          SERIAL_ECHOPGM(") = ");
314
-          SERIAL_ECHO_F(z0, 6);
311
+          SERIAL_CHAR(','); SERIAL_ECHO(ry0);
312
+          SERIAL_ECHOPAIR_F(") = ", z0, 6);
315 313
         }
316 314
       #endif
317 315
 
318 316
       #if ENABLED(DEBUG_LEVELING_FEATURE)
319
-        if (DEBUGGING(MESH_ADJUST)) {
320
-          SERIAL_ECHOPGM(" >>>---> ");
321
-          SERIAL_ECHO_F(z0, 6);
322
-          SERIAL_EOL();
323
-        }
317
+        if (DEBUGGING(MESH_ADJUST)) SERIAL_ECHOLNPAIR_F(" >>>---> ", z0, 6);
324 318
       #endif
325 319
 
326 320
       if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN

+ 122
- 163
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Прегледај датотеку

@@ -331,23 +331,23 @@
331 331
             // meant to invalidate the ENTIRE mesh, which cannot be done with
332 332
             // find_closest_mesh_point loop which only returns REACHABLE points.
333 333
             set_all_mesh_points_to_value(NAN);
334
-            SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n");
334
+            SERIAL_ECHOLNPGM("Entire Mesh invalidated.\n");
335 335
             break;            // No more invalid Mesh Points to populate
336 336
           }
337 337
           z_values[location.x_index][location.y_index] = NAN;
338 338
           cnt++;
339 339
         }
340 340
       }
341
-      SERIAL_PROTOCOLLNPGM("Locations invalidated.\n");
341
+      SERIAL_ECHOLNPGM("Locations invalidated.\n");
342 342
     }
343 343
 
344 344
     if (parser.seen('Q')) {
345 345
       const int test_pattern = parser.has_value() ? parser.value_int() : -99;
346 346
       if (!WITHIN(test_pattern, -1, 2)) {
347
-        SERIAL_PROTOCOLLNPGM("Invalid test_pattern value. (-1 to 2)\n");
347
+        SERIAL_ECHOLNPGM("Invalid test_pattern value. (-1 to 2)\n");
348 348
         return;
349 349
       }
350
-      SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n");
350
+      SERIAL_ECHOLNPGM("Loading test_pattern values.\n");
351 351
       switch (test_pattern) {
352 352
 
353 353
         #if ENABLED(UBL_DEVEL_DEBUGGING)
@@ -405,7 +405,7 @@
405 405
     if (parser.seen('P')) {
406 406
       if (WITHIN(g29_phase_value, 0, 1) && storage_slot == -1) {
407 407
         storage_slot = 0;
408
-        SERIAL_PROTOCOLLNPGM("Default storage slot 0 selected.");
408
+        SERIAL_ECHOLNPGM("Default storage slot 0 selected.");
409 409
       }
410 410
 
411 411
       switch (g29_phase_value) {
@@ -414,7 +414,7 @@
414 414
           // Zero Mesh Data
415 415
           //
416 416
           reset();
417
-          SERIAL_PROTOCOLLNPGM("Mesh zeroed.");
417
+          SERIAL_ECHOLNPGM("Mesh zeroed.");
418 418
           break;
419 419
 
420 420
         #if HAS_BED_PROBE
@@ -425,13 +425,13 @@
425 425
             //
426 426
             if (!parser.seen('C')) {
427 427
               invalidate();
428
-              SERIAL_PROTOCOLLNPGM("Mesh invalidated. Probing mesh.");
428
+              SERIAL_ECHOLNPGM("Mesh invalidated. Probing mesh.");
429 429
             }
430 430
             if (g29_verbose_level > 1) {
431
-              SERIAL_PROTOCOLPAIR("Probing Mesh Points Closest to (", g29_x_pos);
432
-              SERIAL_PROTOCOLCHAR(',');
433
-              SERIAL_PROTOCOL(g29_y_pos);
434
-              SERIAL_PROTOCOLLNPGM(").\n");
431
+              SERIAL_ECHOPAIR("Probing Mesh Points Closest to (", g29_x_pos);
432
+              SERIAL_CHAR(',');
433
+              SERIAL_ECHO(g29_y_pos);
434
+              SERIAL_ECHOLNPGM(").\n");
435 435
             }
436 436
             probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER,
437 437
                               parser.seen('T'), parser.seen('E'), parser.seen('U'));
@@ -446,7 +446,7 @@
446 446
             //
447 447
             // Manually Probe Mesh in areas that can't be reached by the probe
448 448
             //
449
-            SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations.");
449
+            SERIAL_ECHOLNPGM("Manually probing unreachable mesh locations.");
450 450
             do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
451 451
 
452 452
             if (parser.seen('C') && !g29_x_flag && !g29_y_flag) {
@@ -469,26 +469,26 @@
469 469
             if (parser.seen('B')) {
470 470
               g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES);
471 471
               if (ABS(g29_card_thickness) > 1.5f) {
472
-                SERIAL_PROTOCOLLNPGM("?Error in Business Card measurement.");
472
+                SERIAL_ECHOLNPGM("?Error in Business Card measurement.");
473 473
                 return;
474 474
               }
475 475
             }
476 476
 
477 477
             if (!position_is_reachable(g29_x_pos, g29_y_pos)) {
478
-              SERIAL_PROTOCOLLNPGM("XY outside printable radius.");
478
+              SERIAL_ECHOLNPGM("XY outside printable radius.");
479 479
               return;
480 480
             }
481 481
 
482 482
             const float height = parser.floatval('H', Z_CLEARANCE_BETWEEN_PROBES);
483 483
             manually_probe_remaining_mesh(g29_x_pos, g29_y_pos, height, g29_card_thickness, parser.seen('T'));
484 484
 
485
-            SERIAL_PROTOCOLLNPGM("G29 P2 finished.");
485
+            SERIAL_ECHOLNPGM("G29 P2 finished.");
486 486
 
487 487
             report_current_position();
488 488
 
489 489
           #else
490 490
 
491
-            SERIAL_PROTOCOLLNPGM("?P2 is only available when an LCD is present.");
491
+            SERIAL_ECHOLNPGM("?P2 is only available when an LCD is present.");
492 492
             return;
493 493
 
494 494
           #endif
@@ -553,7 +553,7 @@
553 553
           #if HAS_LCD_MENU
554 554
             fine_tune_mesh(g29_x_pos, g29_y_pos, parser.seen('T'));
555 555
           #else
556
-            SERIAL_PROTOCOLLNPGM("?P4 is only available when an LCD is present.");
556
+            SERIAL_ECHOLNPGM("?P4 is only available when an LCD is present.");
557 557
             return;
558 558
           #endif
559 559
           break;
@@ -593,20 +593,20 @@
593 593
       int16_t a = settings.calc_num_meshes();
594 594
 
595 595
       if (!a) {
596
-        SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
596
+        SERIAL_ECHOLNPGM("?EEPROM storage not available.");
597 597
         return;
598 598
       }
599 599
 
600 600
       if (!WITHIN(g29_storage_slot, 0, a - 1)) {
601
-        SERIAL_PROTOCOLLNPGM("?Invalid storage slot.");
602
-        SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
601
+        SERIAL_ECHOLNPGM("?Invalid storage slot.");
602
+        SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
603 603
         return;
604 604
       }
605 605
 
606 606
       settings.load_mesh(g29_storage_slot);
607 607
       storage_slot = g29_storage_slot;
608 608
 
609
-      SERIAL_PROTOCOLLNPGM("Done.");
609
+      SERIAL_ECHOLNPGM("Done.");
610 610
     }
611 611
 
612 612
     //
@@ -622,20 +622,20 @@
622 622
       int16_t a = settings.calc_num_meshes();
623 623
 
624 624
       if (!a) {
625
-        SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
625
+        SERIAL_ECHOLNPGM("?EEPROM storage not available.");
626 626
         goto LEAVE;
627 627
       }
628 628
 
629 629
       if (!WITHIN(g29_storage_slot, 0, a - 1)) {
630
-        SERIAL_PROTOCOLLNPGM("?Invalid storage slot.");
631
-        SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
630
+        SERIAL_ECHOLNPGM("?Invalid storage slot.");
631
+        SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
632 632
         goto LEAVE;
633 633
       }
634 634
 
635 635
       settings.store_mesh(g29_storage_slot);
636 636
       storage_slot = g29_storage_slot;
637 637
 
638
-      SERIAL_PROTOCOLLNPGM("Done.");
638
+      SERIAL_ECHOLNPGM("Done.");
639 639
     }
640 640
 
641 641
     if (parser.seen('T'))
@@ -675,14 +675,10 @@
675 675
           sum_of_diff_squared += sq(z_values[x][y] - mean);
676 676
 
677 677
     SERIAL_ECHOLNPAIR("# of samples: ", n);
678
-    SERIAL_ECHOPGM("Mean Mesh Height: ");
679
-    SERIAL_ECHO_F(mean, 6);
680
-    SERIAL_EOL();
678
+    SERIAL_ECHOLNPAIR_F("Mean Mesh Height: ", mean, 6);
681 679
 
682 680
     const float sigma = SQRT(sum_of_diff_squared / (n + 1));
683
-    SERIAL_ECHOPGM("Standard Deviation: ");
684
-    SERIAL_ECHO_F(sigma, 6);
685
-    SERIAL_EOL();
681
+    SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6);
686 682
 
687 683
     if (cflag)
688 684
       for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
@@ -721,7 +717,7 @@
721 717
         #if HAS_LCD_MENU
722 718
           if (ui.button_pressed()) {
723 719
             ui.quick_feedback(false); // Preserve button state for click-and-hold
724
-            SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n");
720
+            SERIAL_ECHOLNPGM("\nMesh only partially populated.\n");
725 721
             STOW_PROBE();
726 722
             ui.wait_for_release();
727 723
             ui.quick_feedback();
@@ -803,7 +799,7 @@
803 799
       return current_position[Z_AXIS];
804 800
     }
805 801
 
806
-    static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); }
802
+    static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); }
807 803
 
808 804
     float unified_bed_leveling::measure_business_card_thickness(float in_height) {
809 805
       ui.capture();
@@ -813,7 +809,7 @@
813 809
         //, MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f);
814 810
       planner.synchronize();
815 811
 
816
-      SERIAL_PROTOCOLPGM("Place shim under nozzle");
812
+      SERIAL_ECHOPGM("Place shim under nozzle");
817 813
       LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
818 814
       ui.return_to_status();
819 815
       echo_and_take_a_measurement();
@@ -822,7 +818,7 @@
822 818
       do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE);
823 819
       planner.synchronize();
824 820
 
825
-      SERIAL_PROTOCOLPGM("Remove shim");
821
+      SERIAL_ECHOPGM("Remove shim");
826 822
       LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE);
827 823
       echo_and_take_a_measurement();
828 824
 
@@ -833,9 +829,8 @@
833 829
       const float thickness = ABS(z1 - z2);
834 830
 
835 831
       if (g29_verbose_level > 1) {
836
-        SERIAL_PROTOCOLPGM("Business Card is ");
837
-        SERIAL_PROTOCOL_F(thickness, 4);
838
-        SERIAL_PROTOCOLLNPGM("mm thick.");
832
+        SERIAL_ECHOPAIR_F("Business Card is ", thickness, 4);
833
+        SERIAL_ECHOLNPGM("mm thick.");
839 834
       }
840 835
 
841 836
       ui.release();
@@ -846,7 +841,7 @@
846 841
     }
847 842
 
848 843
     void abort_manual_probe_remaining_mesh() {
849
-      SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.");
844
+      SERIAL_ECHOLNPGM("\nMesh only partially populated.");
850 845
       do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
851 846
       ui.release();
852 847
       KEEPALIVE_STATE(IN_HANDLER);
@@ -892,7 +887,7 @@
892 887
         move_z_with_encoder(z_step);
893 888
 
894 889
         if (click_and_hold()) {
895
-          SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.");
890
+          SERIAL_ECHOLNPGM("\nMesh only partially populated.");
896 891
           do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);
897 892
           ui.release();
898 893
           KEEPALIVE_STATE(IN_HANDLER);
@@ -901,11 +896,8 @@
901 896
         }
902 897
 
903 898
         z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick;
904
-        if (g29_verbose_level > 2) {
905
-          SERIAL_PROTOCOLPGM("Mesh Point Measured at: ");
906
-          SERIAL_PROTOCOL_F(z_values[location.x_index][location.y_index], 6);
907
-          SERIAL_EOL();
908
-        }
899
+        if (g29_verbose_level > 2)
900
+          SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[location.x_index][location.y_index], 6);
909 901
         SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
910 902
       } while (location.x_index >= 0 && location.y_index >= 0);
911 903
 
@@ -934,7 +926,7 @@
934 926
       #if ENABLED(UBL_MESH_EDIT_MOVES_Z)
935 927
         const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0;
936 928
         if (!WITHIN(h_offset, 0, 10)) {
937
-          SERIAL_PROTOCOLLNPGM("Offset out of bounds. (0 to 10mm)\n");
929
+          SERIAL_ECHOLNPGM("Offset out of bounds. (0 to 10mm)\n");
938 930
           return;
939 931
         }
940 932
       #endif
@@ -942,7 +934,7 @@
942 934
       mesh_index_pair location;
943 935
 
944 936
       if (!position_is_reachable(rx, ry)) {
945
-        SERIAL_PROTOCOLLNPGM("(X,Y) outside printable radius.");
937
+        SERIAL_ECHOLNPGM("(X,Y) outside printable radius.");
946 938
         return;
947 939
       }
948 940
 
@@ -1050,14 +1042,14 @@
1050 1042
       g29_repetition_cnt = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS;
1051 1043
       NOMORE(g29_repetition_cnt, GRID_MAX_POINTS);
1052 1044
       if (g29_repetition_cnt < 1) {
1053
-        SERIAL_PROTOCOLLNPGM("?(R)epetition count invalid (1+).\n");
1045
+        SERIAL_ECHOLNPGM("?(R)epetition count invalid (1+).\n");
1054 1046
         return UBL_ERR;
1055 1047
       }
1056 1048
     }
1057 1049
 
1058 1050
     g29_verbose_level = parser.seen('V') ? parser.value_int() : 0;
1059 1051
     if (!WITHIN(g29_verbose_level, 0, 4)) {
1060
-      SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).\n");
1052
+      SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4).\n");
1061 1053
       err_flag = true;
1062 1054
     }
1063 1055
 
@@ -1065,7 +1057,7 @@
1065 1057
       const int pv = parser.value_int();
1066 1058
       #if !HAS_BED_PROBE
1067 1059
         if (pv == 1) {
1068
-          SERIAL_PROTOCOLLNPGM("G29 P1 requires a probe.\n");
1060
+          SERIAL_ECHOLNPGM("G29 P1 requires a probe.\n");
1069 1061
           err_flag = true;
1070 1062
         }
1071 1063
         else
@@ -1073,7 +1065,7 @@
1073 1065
         {
1074 1066
           g29_phase_value = pv;
1075 1067
           if (!WITHIN(g29_phase_value, 0, 6)) {
1076
-            SERIAL_PROTOCOLLNPGM("?(P)hase value invalid (0-6).\n");
1068
+            SERIAL_ECHOLNPGM("?(P)hase value invalid (0-6).\n");
1077 1069
             err_flag = true;
1078 1070
           }
1079 1071
         }
@@ -1083,17 +1075,17 @@
1083 1075
       #if HAS_BED_PROBE
1084 1076
         g29_grid_size = parser.has_value() ? parser.value_int() : 0;
1085 1077
         if (g29_grid_size && !WITHIN(g29_grid_size, 2, 9)) {
1086
-          SERIAL_PROTOCOLLNPGM("?Invalid grid size (J) specified (2-9).\n");
1078
+          SERIAL_ECHOLNPGM("?Invalid grid size (J) specified (2-9).\n");
1087 1079
           err_flag = true;
1088 1080
         }
1089 1081
       #else
1090
-        SERIAL_PROTOCOLLNPGM("G29 J action requires a probe.\n");
1082
+        SERIAL_ECHOLNPGM("G29 J action requires a probe.\n");
1091 1083
         err_flag = true;
1092 1084
       #endif
1093 1085
     }
1094 1086
 
1095 1087
     if (g29_x_flag != g29_y_flag) {
1096
-      SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n");
1088
+      SERIAL_ECHOLNPGM("Both X & Y locations must be specified.\n");
1097 1089
       err_flag = true;
1098 1090
     }
1099 1091
 
@@ -1111,7 +1103,7 @@
1111 1103
      */
1112 1104
     if (parser.seen('A')) {
1113 1105
       if (parser.seen('D')) {
1114
-        SERIAL_PROTOCOLLNPGM("?Can't activate and deactivate at the same time.\n");
1106
+        SERIAL_ECHOLNPGM("?Can't activate and deactivate at the same time.\n");
1115 1107
         return UBL_ERR;
1116 1108
       }
1117 1109
       set_bed_leveling_enabled(true);
@@ -1130,7 +1122,7 @@
1130 1122
       if (parser.seenval('F')) {
1131 1123
         const float fh = parser.value_float();
1132 1124
         if (!WITHIN(fh, 0, 100)) {
1133
-          SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n");
1125
+          SERIAL_ECHOLNPGM("?(F)ade height for Bed Level Correction not plausible.\n");
1134 1126
           return UBL_ERR;
1135 1127
         }
1136 1128
         set_z_fade_height(fh);
@@ -1139,7 +1131,7 @@
1139 1131
 
1140 1132
     g29_map_type = parser.intval('T');
1141 1133
     if (!WITHIN(g29_map_type, 0, 2)) {
1142
-      SERIAL_PROTOCOLLNPGM("Invalid map type.\n");
1134
+      SERIAL_ECHOLNPGM("Invalid map type.\n");
1143 1135
       return UBL_ERR;
1144 1136
     }
1145 1137
     return UBL_OK;
@@ -1435,29 +1427,23 @@
1435 1427
               #if ENABLED(DEBUG_LEVELING_FEATURE)
1436 1428
                 if (DEBUGGING(LEVELING)) {
1437 1429
                   SERIAL_CHAR('(');
1438
-                  SERIAL_PROTOCOL_F(rx, 7);
1430
+                  SERIAL_ECHO_F(rx, 7);
1439 1431
                   SERIAL_CHAR(',');
1440
-                  SERIAL_PROTOCOL_F(ry, 7);
1432
+                  SERIAL_ECHO_F(ry, 7);
1441 1433
                   SERIAL_ECHOPGM(")   logical: ");
1442 1434
                   SERIAL_CHAR('(');
1443
-                  SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 7);
1435
+                  SERIAL_ECHO_F(LOGICAL_X_POSITION(rx), 7);
1444 1436
                   SERIAL_CHAR(',');
1445
-                  SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 7);
1446
-                  SERIAL_ECHOPGM(")   measured: ");
1447
-                  SERIAL_PROTOCOL_F(measured_z, 7);
1448
-                  SERIAL_ECHOPGM("   correction: ");
1449
-                  SERIAL_PROTOCOL_F(get_z_correction(rx, ry), 7);
1437
+                  SERIAL_ECHO_F(LOGICAL_Y_POSITION(ry), 7);
1438
+                  SERIAL_ECHOPAIR_F(")   measured: ", measured_z, 7);
1439
+                  SERIAL_ECHOPAIR_F("   correction: ", get_z_correction(rx, ry), 7);
1450 1440
                 }
1451 1441
               #endif
1452 1442
 
1453 1443
               measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ;
1454 1444
 
1455 1445
               #if ENABLED(DEBUG_LEVELING_FEATURE)
1456
-                if (DEBUGGING(LEVELING)) {
1457
-                  SERIAL_ECHOPGM("   final >>>---> ");
1458
-                  SERIAL_PROTOCOL_F(measured_z, 7);
1459
-                  SERIAL_EOL();
1460
-                }
1446
+                if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR_F("   final >>>---> ", measured_z, 7);
1461 1447
               #endif
1462 1448
               if (g29_verbose_level > 3) {
1463 1449
                 serial_spaces(16);
@@ -1483,12 +1469,11 @@
1483 1469
       vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal();
1484 1470
 
1485 1471
       if (g29_verbose_level > 2) {
1486
-        SERIAL_ECHOPGM("bed plane normal = [");
1487
-        SERIAL_PROTOCOL_F(normal.x, 7);
1488
-        SERIAL_PROTOCOLCHAR(',');
1489
-        SERIAL_PROTOCOL_F(normal.y, 7);
1490
-        SERIAL_PROTOCOLCHAR(',');
1491
-        SERIAL_PROTOCOL_F(normal.z, 7);
1472
+        SERIAL_ECHOPAIR_F("bed plane normal = [", normal.x, 7);
1473
+        SERIAL_CHAR(',');
1474
+        SERIAL_ECHO_F(normal.y, 7);
1475
+        SERIAL_CHAR(',');
1476
+        SERIAL_ECHO_F(normal.z, 7);
1492 1477
         SERIAL_ECHOLNPGM("]");
1493 1478
       }
1494 1479
 
@@ -1502,12 +1487,11 @@
1502 1487
 
1503 1488
           #if ENABLED(DEBUG_LEVELING_FEATURE)
1504 1489
             if (DEBUGGING(LEVELING)) {
1505
-              SERIAL_ECHOPGM("before rotation = [");
1506
-              SERIAL_PROTOCOL_F(x_tmp, 7);
1507
-              SERIAL_PROTOCOLCHAR(',');
1508
-              SERIAL_PROTOCOL_F(y_tmp, 7);
1509
-              SERIAL_PROTOCOLCHAR(',');
1510
-              SERIAL_PROTOCOL_F(z_tmp, 7);
1490
+              SERIAL_ECHOPAIR_F("before rotation = [", x_tmp, 7);
1491
+              SERIAL_CHAR(',');
1492
+              SERIAL_ECHO_F(y_tmp, 7);
1493
+              SERIAL_CHAR(',');
1494
+              SERIAL_ECHO_F(z_tmp, 7);
1511 1495
               SERIAL_ECHOPGM("]   ---> ");
1512 1496
               serial_delay(20);
1513 1497
             }
@@ -1517,12 +1501,11 @@
1517 1501
 
1518 1502
           #if ENABLED(DEBUG_LEVELING_FEATURE)
1519 1503
             if (DEBUGGING(LEVELING)) {
1520
-              SERIAL_ECHOPGM("after rotation = [");
1521
-              SERIAL_PROTOCOL_F(x_tmp, 7);
1522
-              SERIAL_PROTOCOLCHAR(',');
1523
-              SERIAL_PROTOCOL_F(y_tmp, 7);
1524
-              SERIAL_PROTOCOLCHAR(',');
1525
-              SERIAL_PROTOCOL_F(z_tmp, 7);
1504
+              SERIAL_ECHOPAIR_F("after rotation = [", x_tmp, 7);
1505
+              SERIAL_CHAR(',');
1506
+              SERIAL_ECHO_F(y_tmp, 7);
1507
+              SERIAL_CHAR(',');
1508
+              SERIAL_ECHO_F(z_tmp, 7);
1526 1509
               SERIAL_ECHOLNPGM("]");
1527 1510
               serial_delay(55);
1528 1511
             }
@@ -1535,22 +1518,17 @@
1535 1518
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1536 1519
         if (DEBUGGING(LEVELING)) {
1537 1520
           rotation.debug(PSTR("rotation matrix:\n"));
1538
-          SERIAL_ECHOPGM("LSF Results A=");
1539
-          SERIAL_PROTOCOL_F(lsf_results.A, 7);
1540
-          SERIAL_ECHOPGM("  B=");
1541
-          SERIAL_PROTOCOL_F(lsf_results.B, 7);
1542
-          SERIAL_ECHOPGM("  D=");
1543
-          SERIAL_PROTOCOL_F(lsf_results.D, 7);
1544
-          SERIAL_EOL();
1521
+          SERIAL_ECHOPAIR_F("LSF Results A=", lsf_results.A, 7);
1522
+          SERIAL_ECHOPAIR_F("  B=", lsf_results.B, 7);
1523
+          SERIAL_ECHOLNPAIR_F("  D=", lsf_results.D, 7);
1545 1524
           serial_delay(55);
1546 1525
 
1547
-          SERIAL_ECHOPGM("bed plane normal = [");
1548
-          SERIAL_PROTOCOL_F(normal.x, 7);
1549
-          SERIAL_PROTOCOLCHAR(',');
1550
-          SERIAL_PROTOCOL_F(normal.y, 7);
1551
-          SERIAL_PROTOCOLCHAR(',');
1552
-          SERIAL_PROTOCOL_F(normal.z, 7);
1553
-          SERIAL_ECHOPGM("]\n");
1526
+          SERIAL_ECHOPAIR_F("bed plane normal = [", normal.x, 7);
1527
+          SERIAL_CHAR(',');
1528
+          SERIAL_ECHO_F(normal.y, 7);
1529
+          SERIAL_CHAR(',');
1530
+          SERIAL_ECHO_F(normal.z, 7);
1531
+          SERIAL_ECHOLNPGM("]");
1554 1532
           SERIAL_EOL();
1555 1533
 
1556 1534
           /**
@@ -1565,45 +1543,31 @@
1565 1543
           float t, t1, d;
1566 1544
           t = normal.x * (PROBE_PT_1_X) + normal.y * (PROBE_PT_1_Y);
1567 1545
           d = t + normal.z * z1;
1568
-          SERIAL_ECHOPGM("D from 1st point: ");
1569
-          SERIAL_ECHO_F(d, 6);
1570
-          SERIAL_ECHOPGM("   Z error: ");
1571
-          SERIAL_ECHO_F(normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6);
1572
-          SERIAL_EOL();
1546
+          SERIAL_ECHOPAIR_F("D from 1st point: ", d, 6);
1547
+          SERIAL_ECHOLNPAIR_F("   Z error: ", normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6);
1573 1548
 
1574 1549
           t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y);
1575 1550
           d = t + normal.z * z2;
1576 1551
           SERIAL_EOL();
1577
-          SERIAL_ECHOPGM("D from 2nd point: ");
1578
-          SERIAL_ECHO_F(d, 6);
1579
-          SERIAL_ECHOPGM("   Z error: ");
1580
-          SERIAL_ECHO_F(normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6);
1581
-          SERIAL_EOL();
1552
+          SERIAL_ECHOPAIR_F("D from 2nd point: ", d, 6);
1553
+          SERIAL_ECHOLNPAIR_F("   Z error: ", normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6);
1582 1554
 
1583 1555
           t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y);
1584 1556
           d = t + normal.z * z3;
1585
-          SERIAL_ECHOPGM("D from 3rd point: ");
1586
-          SERIAL_ECHO_F(d, 6);
1587
-          SERIAL_ECHOPGM("   Z error: ");
1588
-          SERIAL_ECHO_F(normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6);
1589
-          SERIAL_EOL();
1557
+          SERIAL_ECHOPAIR_F("D from 3rd point: ", d, 6);
1558
+          SERIAL_ECHOLNPAIR_F("   Z error: ", normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6);
1590 1559
 
1591 1560
           t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT);
1592 1561
           d = t + normal.z * 0;
1593
-          SERIAL_ECHOPGM("D from home location with Z=0 : ");
1594
-          SERIAL_ECHO_F(d, 6);
1595
-          SERIAL_EOL();
1562
+          SERIAL_ECHOLNPAIR_F("D from home location with Z=0 : ", d, 6);
1596 1563
 
1597 1564
           t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT);
1598 1565
           d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0;
1599
-          SERIAL_ECHOPGM("D from home location using mesh value for Z: ");
1600
-          SERIAL_ECHO_F(d, 6);
1566
+          SERIAL_ECHOPAIR_F("D from home location using mesh value for Z: ", d, 6);
1601 1567
 
1602 1568
           SERIAL_ECHOPAIR("   Z error: (", Z_SAFE_HOMING_X_POINT);
1603
-          SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT );
1604
-          SERIAL_ECHOPGM(") = ");
1605
-          SERIAL_ECHO_F(get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6);
1606
-          SERIAL_EOL();
1569
+          SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT);
1570
+          SERIAL_ECHOLNPAIR_F(") = ", get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6);
1607 1571
           #endif
1608 1572
         } // DEBUGGING(LEVELING)
1609 1573
       #endif
@@ -1675,26 +1639,22 @@
1675 1639
       report_state();
1676 1640
 
1677 1641
       if (storage_slot == -1)
1678
-        SERIAL_PROTOCOLPGM("No Mesh Loaded.");
1642
+        SERIAL_ECHOPGM("No Mesh Loaded.");
1679 1643
       else {
1680
-        SERIAL_PROTOCOLPAIR("Mesh ", storage_slot);
1681
-        SERIAL_PROTOCOLPGM(" Loaded.");
1644
+        SERIAL_ECHOPAIR("Mesh ", storage_slot);
1645
+        SERIAL_ECHOPGM(" Loaded.");
1682 1646
       }
1683 1647
       SERIAL_EOL();
1684 1648
       serial_delay(50);
1685 1649
 
1686 1650
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1687
-        SERIAL_PROTOCOLPGM("planner.z_fade_height : ");
1688
-        SERIAL_PROTOCOL_F(planner.z_fade_height, 4);
1689
-        SERIAL_EOL();
1651
+        SERIAL_ECHOLNPAIR_F("planner.z_fade_height : ", planner.z_fade_height, 4);
1690 1652
       #endif
1691 1653
 
1692 1654
       adjust_mesh_to_mean(g29_c_flag, g29_constant);
1693 1655
 
1694 1656
       #if HAS_BED_PROBE
1695
-        SERIAL_PROTOCOLPGM("zprobe_zoffset: ");
1696
-        SERIAL_PROTOCOL_F(zprobe_zoffset, 7);
1697
-        SERIAL_EOL();
1657
+        SERIAL_ECHOLNPAIR_F("zprobe_zoffset: ", zprobe_zoffset, 7);
1698 1658
       #endif
1699 1659
 
1700 1660
       SERIAL_ECHOLNPAIR("MESH_MIN_X  " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50);
@@ -1706,53 +1666,53 @@
1706 1666
       SERIAL_ECHOLNPAIR("MESH_X_DIST  ", MESH_X_DIST);
1707 1667
       SERIAL_ECHOLNPAIR("MESH_Y_DIST  ", MESH_Y_DIST);                         serial_delay(50);
1708 1668
 
1709
-      SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: ");
1669
+      SERIAL_ECHOPGM("X-Axis Mesh Points at: ");
1710 1670
       for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
1711
-        SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3);
1712
-        SERIAL_PROTOCOLPGM("  ");
1671
+        SERIAL_ECHO_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3);
1672
+        SERIAL_ECHOPGM("  ");
1713 1673
         serial_delay(25);
1714 1674
       }
1715 1675
       SERIAL_EOL();
1716 1676
 
1717
-      SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: ");
1677
+      SERIAL_ECHOPGM("Y-Axis Mesh Points at: ");
1718 1678
       for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) {
1719
-        SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3);
1720
-        SERIAL_PROTOCOLPGM("  ");
1679
+        SERIAL_ECHO_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3);
1680
+        SERIAL_ECHOPGM("  ");
1721 1681
         serial_delay(25);
1722 1682
       }
1723 1683
       SERIAL_EOL();
1724 1684
 
1725 1685
       #if HAS_KILL
1726
-        SERIAL_PROTOCOLPAIR("Kill pin on :", KILL_PIN);
1727
-        SERIAL_PROTOCOLLNPAIR("  state:", READ(KILL_PIN));
1686
+        SERIAL_ECHOPAIR("Kill pin on :", KILL_PIN);
1687
+        SERIAL_ECHOLNPAIR("  state:", READ(KILL_PIN));
1728 1688
       #endif
1729 1689
       SERIAL_EOL();
1730 1690
       serial_delay(50);
1731 1691
 
1732 1692
       #if ENABLED(UBL_DEVEL_DEBUGGING)
1733
-        SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); SERIAL_EOL();
1734
-        SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); SERIAL_EOL();
1693
+        SERIAL_ECHOLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); SERIAL_EOL();
1694
+        SERIAL_ECHOLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); SERIAL_EOL();
1735 1695
         serial_delay(50);
1736 1696
 
1737
-        SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()));
1738
-        SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.meshes_end_index()));
1697
+        SERIAL_ECHOPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()));
1698
+        SERIAL_ECHOLNPAIR(" to ", hex_address((void*)settings.meshes_end_index()));
1739 1699
         serial_delay(50);
1740 1700
 
1741
-        SERIAL_PROTOCOLLNPAIR("sizeof(ubl) :  ", (int)sizeof(ubl));         SERIAL_EOL();
1742
-        SERIAL_PROTOCOLLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); SERIAL_EOL();
1701
+        SERIAL_ECHOLNPAIR("sizeof(ubl) :  ", (int)sizeof(ubl));         SERIAL_EOL();
1702
+        SERIAL_ECHOLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); SERIAL_EOL();
1743 1703
         serial_delay(25);
1744 1704
 
1745
-        SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index())));
1705
+        SERIAL_ECHOLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index())));
1746 1706
         serial_delay(50);
1747 1707
 
1748
-        SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes());
1749
-        SERIAL_PROTOCOLLNPGM(" meshes.\n");
1708
+        SERIAL_ECHOPAIR("EEPROM can hold ", settings.calc_num_meshes());
1709
+        SERIAL_ECHOLNPGM(" meshes.\n");
1750 1710
         serial_delay(25);
1751 1711
       #endif // UBL_DEVEL_DEBUGGING
1752 1712
 
1753 1713
       if (!sanity_check()) {
1754 1714
         echo_name();
1755
-        SERIAL_PROTOCOLLNPGM(" sanity checks passed.");
1715
+        SERIAL_ECHOLNPGM(" sanity checks passed.");
1756 1716
       }
1757 1717
     }
1758 1718
 
@@ -1763,8 +1723,7 @@
1763 1723
     void unified_bed_leveling::g29_eeprom_dump() {
1764 1724
       uint8_t cccc;
1765 1725
 
1766
-      SERIAL_ECHO_START();
1767
-      SERIAL_ECHOLNPGM("EEPROM Dump:");
1726
+      SERIAL_ECHO_MSG("EEPROM Dump:");
1768 1727
       persistentStore.access_start();
1769 1728
       for (uint16_t i = 0; i < persistentStore.capacity(); i += 16) {
1770 1729
         if (!(i & 0x3)) idle();
@@ -1773,7 +1732,7 @@
1773 1732
         for (uint16_t j = 0; j < 16; j++) {
1774 1733
           persistentStore.read_data(i + j, &cccc, sizeof(uint8_t));
1775 1734
           print_hex_byte(cccc);
1776
-          SERIAL_ECHO(' ');
1735
+          SERIAL_CHAR(' ');
1777 1736
         }
1778 1737
         SERIAL_EOL();
1779 1738
       }
@@ -1789,29 +1748,29 @@
1789 1748
       int16_t a = settings.calc_num_meshes();
1790 1749
 
1791 1750
       if (!a) {
1792
-        SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
1751
+        SERIAL_ECHOLNPGM("?EEPROM storage not available.");
1793 1752
         return;
1794 1753
       }
1795 1754
 
1796 1755
       if (!parser.has_value()) {
1797
-        SERIAL_PROTOCOLLNPGM("?Storage slot # required.");
1798
-        SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
1756
+        SERIAL_ECHOLNPGM("?Storage slot # required.");
1757
+        SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
1799 1758
         return;
1800 1759
       }
1801 1760
 
1802 1761
       g29_storage_slot = parser.value_int();
1803 1762
 
1804 1763
       if (!WITHIN(g29_storage_slot, 0, a - 1)) {
1805
-        SERIAL_PROTOCOLLNPGM("?Invalid storage slot.");
1806
-        SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
1764
+        SERIAL_ECHOLNPGM("?Invalid storage slot.");
1765
+        SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
1807 1766
         return;
1808 1767
       }
1809 1768
 
1810 1769
       float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
1811 1770
       settings.load_mesh(g29_storage_slot, &tmp_z_values);
1812 1771
 
1813
-      SERIAL_PROTOCOLPAIR("Subtracting mesh in slot ", g29_storage_slot);
1814
-      SERIAL_PROTOCOLLNPGM(" from current mesh.");
1772
+      SERIAL_ECHOPAIR("Subtracting mesh in slot ", g29_storage_slot);
1773
+      SERIAL_ECHOLNPGM(" from current mesh.");
1815 1774
 
1816 1775
       for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
1817 1776
         for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)

+ 1
- 2
Marlin/src/feature/dac/stepper_dac.cpp Прегледај датотеку

@@ -103,8 +103,7 @@ void dac_current_set_percents(const uint8_t pct[XYZE]) {
103 103
 void dac_print_values() {
104 104
   if (!dac_present) return;
105 105
 
106
-  SERIAL_ECHO_START();
107
-  SERIAL_ECHOLNPGM("Stepper current values in % (Amps):");
106
+  SERIAL_ECHO_MSG("Stepper current values in % (Amps):");
108 107
   SERIAL_ECHO_START();
109 108
   SERIAL_ECHOPAIR(" X:",  dac_perc(X_AXIS));
110 109
   SERIAL_ECHOPAIR(" (",   dac_amps(X_AXIS));

+ 4
- 8
Marlin/src/feature/pause.cpp Прегледај датотеку

@@ -93,8 +93,7 @@ static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_
93 93
 
94 94
   #if ENABLED(PREVENT_COLD_EXTRUSION)
95 95
     if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
96
-      SERIAL_ERROR_START();
97
-      SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD);
96
+      SERIAL_ERROR_MSG(MSG_ERR_HOTEND_TOO_COLD);
98 97
       return false;
99 98
     }
100 99
   #endif
@@ -142,8 +141,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
142 141
     #if HAS_LCD_MENU
143 142
       if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode);
144 143
     #endif
145
-    SERIAL_ECHO_START();
146
-    SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
144
+    SERIAL_ECHO_MSG(MSG_FILAMENT_CHANGE_INSERT);
147 145
 
148 146
     #if HAS_BUZZER
149 147
       filament_change_beep(max_beep_count, true);
@@ -336,8 +334,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
336 334
   #endif
337 335
 
338 336
   if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) {
339
-    SERIAL_ERROR_START();
340
-    SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD);
337
+    SERIAL_ERROR_MSG(MSG_ERR_HOTEND_TOO_COLD);
341 338
 
342 339
     #if HAS_LCD_MENU
343 340
       if (show_lcd) { // Show status screen
@@ -464,8 +461,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
464 461
       #if HAS_LCD_MENU
465 462
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_HEAT);
466 463
       #endif
467
-      SERIAL_ECHO_START();
468
-      SERIAL_ECHOLNPGM(_PMSG(MSG_FILAMENT_CHANGE_HEAT));
464
+      SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_HEAT));
469 465
 
470 466
       // Wait for LCD click or M108
471 467
       while (wait_for_user) idle(true);

+ 3
- 3
Marlin/src/feature/runout.h Прегледај датотеку

@@ -192,7 +192,7 @@ class FilamentSensorBase {
192 192
 
193 193
         #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG
194 194
           if (change) {
195
-            SERIAL_PROTOCOLPGM("Motion detected:");
195
+            SERIAL_ECHOPGM("Motion detected:");
196 196
             for (uint8_t e = 0; e < NUM_RUNOUT_SENSORS; e++)
197 197
               if (TEST(change, e)) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + e); }
198 198
             SERIAL_EOL();
@@ -253,7 +253,7 @@ class FilamentSensorBase {
253 253
           static bool was_out = false;
254 254
           if (out != was_out) {
255 255
             was_out = out;
256
-            SERIAL_PROTOCOL("Filament ");
256
+            SERIAL_ECHOPGM("Filament ");
257 257
             serialprintPGM(out ? PSTR("OUT\n") : PSTR("IN\n"));
258 258
           }
259 259
         #endif
@@ -289,7 +289,7 @@ class FilamentSensorBase {
289 289
             t = millis() + 1000UL;
290 290
             LOOP_L_N(i, EXTRUDERS) {
291 291
               serialprintPGM(i ? PSTR(", ") : PSTR("Remaining mm: "));
292
-              SERIAL_PROTOCOL(runout_mm_countdown[i]);
292
+              SERIAL_ECHO(runout_mm_countdown[i]);
293 293
             }
294 294
             SERIAL_EOL();
295 295
           }

+ 1
- 2
Marlin/src/feature/solenoid.cpp Прегледај датотеку

@@ -59,8 +59,7 @@ void enable_solenoid(const uint8_t num) {
59 59
           break;
60 60
       #endif
61 61
     default:
62
-      SERIAL_ECHO_START();
63
-      SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID);
62
+      SERIAL_ECHO_MSG(MSG_INVALID_SOLENOID);
64 63
       break;
65 64
   }
66 65
 }

+ 4
- 4
Marlin/src/feature/tmc_util.cpp Прегледај датотеку

@@ -358,12 +358,12 @@
358 358
 
359 359
   template <typename TMC>
360 360
   static void tmc_status(TMC &st, const TMC_debug_enum i, const float spmm) {
361
-    SERIAL_ECHO('\t');
361
+    SERIAL_CHAR('\t');
362 362
     switch (i) {
363 363
       case TMC_CODES: st.printLabel(); break;
364 364
       case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break;
365 365
       case TMC_CURRENT: SERIAL_ECHO(st.getMilliamps()); break;
366
-      case TMC_RMS_CURRENT: SERIAL_PROTOCOL(st.rms_current()); break;
366
+      case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break;
367 367
       case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break;
368 368
       case TMC_IRUN:
369 369
         SERIAL_PRINT(st.irun(), DEC);
@@ -408,12 +408,12 @@
408 408
   #if HAS_DRIVER(TMC2660)
409 409
     template<char AXIS_LETTER, char DRIVER_ID>
410 410
     void tmc_status(TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID> &st, const TMC_debug_enum i, const float) {
411
-      SERIAL_ECHO('\t');
411
+      SERIAL_CHAR('\t');
412 412
       switch (i) {
413 413
         case TMC_CODES: st.printLabel(); break;
414 414
         case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break;
415 415
         case TMC_CURRENT: SERIAL_ECHO(st.getMilliamps()); break;
416
-        case TMC_RMS_CURRENT: SERIAL_PROTOCOL(st.rms_current()); break;
416
+        case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break;
417 417
         case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break;
418 418
         case TMC_IRUN:
419 419
           SERIAL_PRINT(st.cs(), DEC);

+ 1
- 2
Marlin/src/feature/twibus.cpp Прегледај датотеку

@@ -44,8 +44,7 @@ void TWIBus::reset() {
44 44
 
45 45
 void TWIBus::address(const uint8_t adr) {
46 46
   if (!WITHIN(adr, 8, 127)) {
47
-    SERIAL_ECHO_START();
48
-    SERIAL_ECHOLNPGM("Bad I2C address (8-127)");
47
+    SERIAL_ECHO_MSG("Bad I2C address (8-127)");
49 48
   }
50 49
 
51 50
   this->addr = adr;

+ 12
- 12
Marlin/src/gcode/bedlevel/G26.cpp Прегледај датотеку

@@ -573,7 +573,7 @@ void GcodeSuite::G26() {
573 573
   if (parser.seenval('B')) {
574 574
     g26_bed_temp = parser.value_celsius();
575 575
     if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, 140)) {
576
-      SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible (40-140C).");
576
+      SERIAL_ECHOLNPGM("?Specified bed temperature not plausible (40-140C).");
577 577
       return;
578 578
     }
579 579
   }
@@ -581,7 +581,7 @@ void GcodeSuite::G26() {
581 581
   if (parser.seenval('L')) {
582 582
     g26_layer_height = parser.value_linear_units();
583 583
     if (!WITHIN(g26_layer_height, 0.0, 2.0)) {
584
-      SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible.");
584
+      SERIAL_ECHOLNPGM("?Specified layer height not plausible.");
585 585
       return;
586 586
     }
587 587
   }
@@ -590,12 +590,12 @@ void GcodeSuite::G26() {
590 590
     if (parser.has_value()) {
591 591
       g26_retraction_multiplier = parser.value_float();
592 592
       if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) {
593
-        SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible.");
593
+        SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible.");
594 594
         return;
595 595
       }
596 596
     }
597 597
     else {
598
-      SERIAL_PROTOCOLLNPGM("?Retraction Multiplier must be specified.");
598
+      SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified.");
599 599
       return;
600 600
     }
601 601
   }
@@ -603,7 +603,7 @@ void GcodeSuite::G26() {
603 603
   if (parser.seenval('S')) {
604 604
     g26_nozzle = parser.value_float();
605 605
     if (!WITHIN(g26_nozzle, 0.1, 1.0)) {
606
-      SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");
606
+      SERIAL_ECHOLNPGM("?Specified nozzle size not plausible.");
607 607
       return;
608 608
     }
609 609
   }
@@ -613,7 +613,7 @@ void GcodeSuite::G26() {
613 613
       #if HAS_LCD_MENU
614 614
         g26_prime_flag = -1;
615 615
       #else
616
-        SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD.");
616
+        SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD.");
617 617
         return;
618 618
       #endif
619 619
     }
@@ -621,7 +621,7 @@ void GcodeSuite::G26() {
621 621
       g26_prime_flag++;
622 622
       g26_prime_length = parser.value_linear_units();
623 623
       if (!WITHIN(g26_prime_length, 0.0, 25.0)) {
624
-        SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible.");
624
+        SERIAL_ECHOLNPGM("?Specified prime length not plausible.");
625 625
         return;
626 626
       }
627 627
     }
@@ -630,7 +630,7 @@ void GcodeSuite::G26() {
630 630
   if (parser.seenval('F')) {
631 631
     g26_filament_diameter = parser.value_linear_units();
632 632
     if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) {
633
-      SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible.");
633
+      SERIAL_ECHOLNPGM("?Specified filament size not plausible.");
634 634
       return;
635 635
     }
636 636
   }
@@ -643,7 +643,7 @@ void GcodeSuite::G26() {
643 643
   if (parser.seenval('H')) {
644 644
     g26_hotend_temp = parser.value_celsius();
645 645
     if (!WITHIN(g26_hotend_temp, 165, 280)) {
646
-      SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible.");
646
+      SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible.");
647 647
       return;
648 648
     }
649 649
   }
@@ -659,21 +659,21 @@ void GcodeSuite::G26() {
659 659
     g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1);
660 660
   #else
661 661
     if (!parser.seen('R')) {
662
-      SERIAL_PROTOCOLLNPGM("?(R)epeat must be specified when not using an LCD.");
662
+      SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD.");
663 663
       return;
664 664
     }
665 665
     else
666 666
       g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
667 667
   #endif
668 668
   if (g26_repeats < 1) {
669
-    SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1.");
669
+    SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1.");
670 670
     return;
671 671
   }
672 672
 
673 673
   g26_x_pos = parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position[X_AXIS];
674 674
   g26_y_pos = parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position[Y_AXIS];
675 675
   if (!position_is_reachable(g26_x_pos, g26_y_pos)) {
676
-    SERIAL_PROTOCOLLNPGM("?Specified X,Y coordinate out of bounds.");
676
+    SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds.");
677 677
     return;
678 678
   }
679 679
 

+ 6
- 8
Marlin/src/gcode/bedlevel/M420.cpp Прегледај датотеку

@@ -95,13 +95,13 @@ void GcodeSuite::M420() {
95 95
         const int16_t a = settings.calc_num_meshes();
96 96
 
97 97
         if (!a) {
98
-          SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
98
+          SERIAL_ECHOLNPGM("?EEPROM storage not available.");
99 99
           return;
100 100
         }
101 101
 
102 102
         if (!WITHIN(storage_slot, 0, a - 1)) {
103
-          SERIAL_PROTOCOLLNPGM("?Invalid storage slot.");
104
-          SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1);
103
+          SERIAL_ECHOLNPGM("?Invalid storage slot.");
104
+          SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1);
105 105
           return;
106 106
         }
107 107
 
@@ -110,7 +110,7 @@ void GcodeSuite::M420() {
110 110
 
111 111
       #else
112 112
 
113
-        SERIAL_PROTOCOLLNPGM("?EEPROM storage not available.");
113
+        SERIAL_ECHOLNPGM("?EEPROM storage not available.");
114 114
         return;
115 115
 
116 116
       #endif
@@ -206,10 +206,8 @@ void GcodeSuite::M420() {
206 206
   set_bed_leveling_enabled(to_enable);
207 207
 
208 208
   // Error if leveling failed to enable or reenable
209
-  if (to_enable && !planner.leveling_active) {
210
-    SERIAL_ERROR_START();
211
-    SERIAL_ERRORLNPGM(MSG_ERR_M420_FAILED);
212
-  }
209
+  if (to_enable && !planner.leveling_active)
210
+    SERIAL_ERROR_MSG(MSG_ERR_M420_FAILED);
213 211
 
214 212
   SERIAL_ECHO_START();
215 213
   SERIAL_ECHOPGM("Bed Leveling ");

+ 31
- 39
Marlin/src/gcode/bedlevel/abl/G29.cpp Прегледај датотеку

@@ -293,15 +293,13 @@ G29_TYPE GcodeSuite::G29() {
293 293
       const bool seen_w = parser.seen('W');
294 294
       if (seen_w) {
295 295
         if (!leveling_is_valid()) {
296
-          SERIAL_ERROR_START();
297
-          SERIAL_ERRORLNPGM("No bilinear grid");
296
+          SERIAL_ERROR_MSG("No bilinear grid");
298 297
           G29_RETURN(false);
299 298
         }
300 299
 
301 300
         const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position[Z_AXIS];
302 301
         if (!WITHIN(rz, -10, 10)) {
303
-          SERIAL_ERROR_START();
304
-          SERIAL_ERRORLNPGM("Bad Z value");
302
+          SERIAL_ERROR_MSG("Bad Z value");
305 303
           G29_RETURN(false);
306 304
         }
307 305
 
@@ -343,7 +341,7 @@ G29_TYPE GcodeSuite::G29() {
343 341
 
344 342
     verbose_level = parser.intval('V');
345 343
     if (!WITHIN(verbose_level, 0, 4)) {
346
-      SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).");
344
+      SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4).");
347 345
       G29_RETURN(false);
348 346
     }
349 347
 
@@ -364,11 +362,11 @@ G29_TYPE GcodeSuite::G29() {
364 362
       if (parser.seenval('P')) abl_grid_points_x = abl_grid_points_y = parser.value_int();
365 363
 
366 364
       if (!WITHIN(abl_grid_points_x, 2, GRID_MAX_POINTS_X)) {
367
-        SERIAL_PROTOCOLLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ").");
365
+        SERIAL_ECHOLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ").");
368 366
         G29_RETURN(false);
369 367
       }
370 368
       if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) {
371
-        SERIAL_PROTOCOLLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ").");
369
+        SERIAL_ECHOLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ").");
372 370
         G29_RETURN(false);
373 371
       }
374 372
 
@@ -410,7 +408,7 @@ G29_TYPE GcodeSuite::G29() {
410 408
           || !position_is_reachable_by_probe(right_probe_bed_position, back_probe_bed_position)
411 409
         #endif
412 410
       ) {
413
-        SERIAL_PROTOCOLLNPGM("? (L,R,F,B) out of bounds.");
411
+        SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds.");
414 412
         G29_RETURN(false);
415 413
       }
416 414
 
@@ -421,8 +419,8 @@ G29_TYPE GcodeSuite::G29() {
421 419
     #endif // ABL_GRID
422 420
 
423 421
     if (verbose_level > 0) {
424
-      SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling");
425
-      if (dryrun) SERIAL_PROTOCOLPGM(" (DRYRUN)");
422
+      SERIAL_ECHOPGM("G29 Auto Bed Leveling");
423
+      if (dryrun) SERIAL_ECHOPGM(" (DRYRUN)");
426 424
       SERIAL_EOL();
427 425
     }
428 426
 
@@ -491,7 +489,7 @@ G29_TYPE GcodeSuite::G29() {
491 489
 
492 490
     // Abort current G29 procedure, go back to idle state
493 491
     if (seenA && g29_in_progress) {
494
-      SERIAL_PROTOCOLLNPGM("Manual G29 aborted");
492
+      SERIAL_ECHOLNPGM("Manual G29 aborted");
495 493
       #if HAS_SOFTWARE_ENDSTOPS
496 494
         soft_endstops_enabled = enable_soft_endstops;
497 495
       #endif
@@ -504,13 +502,13 @@ G29_TYPE GcodeSuite::G29() {
504 502
 
505 503
     // Query G29 status
506 504
     if (verbose_level || seenQ) {
507
-      SERIAL_PROTOCOLPGM("Manual G29 ");
505
+      SERIAL_ECHOPGM("Manual G29 ");
508 506
       if (g29_in_progress) {
509
-        SERIAL_PROTOCOLPAIR("point ", MIN(abl_probe_index + 1, abl_points));
510
-        SERIAL_PROTOCOLLNPAIR(" of ", abl_points);
507
+        SERIAL_ECHOPAIR("point ", MIN(abl_probe_index + 1, abl_points));
508
+        SERIAL_ECHOLNPAIR(" of ", abl_points);
511 509
       }
512 510
       else
513
-        SERIAL_PROTOCOLLNPGM("idle");
511
+        SERIAL_ECHOLNPGM("idle");
514 512
     }
515 513
 
516 514
     if (no_action) G29_RETURN(false);
@@ -553,9 +551,9 @@ G29_TYPE GcodeSuite::G29() {
553 551
 
554 552
         #if ENABLED(DEBUG_LEVELING_FEATURE)
555 553
           if (DEBUGGING(LEVELING)) {
556
-            SERIAL_PROTOCOLPAIR("Save X", xCount);
557
-            SERIAL_PROTOCOLPAIR(" Y", yCount);
558
-            SERIAL_PROTOCOLLNPAIR(" Z", measured_z + zoffset);
554
+            SERIAL_ECHOPAIR("Save X", xCount);
555
+            SERIAL_ECHOPAIR(" Y", yCount);
556
+            SERIAL_ECHOLNPAIR(" Z", measured_z + zoffset);
559 557
           }
560 558
         #endif
561 559
 
@@ -609,7 +607,7 @@ G29_TYPE GcodeSuite::G29() {
609 607
 
610 608
         // Leveling done! Fall through to G29 finishing code below
611 609
 
612
-        SERIAL_PROTOCOLLNPGM("Grid probing done.");
610
+        SERIAL_ECHOLNPGM("Grid probing done.");
613 611
 
614 612
         // Re-enable software endstops, if needed
615 613
         #if HAS_SOFTWARE_ENDSTOPS
@@ -633,7 +631,7 @@ G29_TYPE GcodeSuite::G29() {
633 631
       }
634 632
       else {
635 633
 
636
-        SERIAL_PROTOCOLLNPGM("3-point probing done.");
634
+        SERIAL_ECHOLNPGM("3-point probing done.");
637 635
 
638 636
         // Re-enable software endstops, if needed
639 637
         #if HAS_SOFTWARE_ENDSTOPS
@@ -829,18 +827,12 @@ G29_TYPE GcodeSuite::G29() {
829 827
       mean /= abl_points;
830 828
 
831 829
       if (verbose_level) {
832
-        SERIAL_PROTOCOLPGM("Eqn coefficients: a: ");
833
-        SERIAL_PROTOCOL_F(plane_equation_coefficients[0], 8);
834
-        SERIAL_PROTOCOLPGM(" b: ");
835
-        SERIAL_PROTOCOL_F(plane_equation_coefficients[1], 8);
836
-        SERIAL_PROTOCOLPGM(" d: ");
837
-        SERIAL_PROTOCOL_F(plane_equation_coefficients[2], 8);
830
+        SERIAL_ECHOPAIR_F("Eqn coefficients: a: ", plane_equation_coefficients[0], 8);
831
+        SERIAL_ECHOPAIR_F(" b: ", plane_equation_coefficients[1], 8);
832
+        SERIAL_ECHOPAIR_F(" d: ", plane_equation_coefficients[2], 8);
833
+        if (verbose_level > 2)
834
+          SERIAL_ECHOPAIR_F("\nMean of sampled points: ", mean, 8);
838 835
         SERIAL_EOL();
839
-        if (verbose_level > 2) {
840
-          SERIAL_PROTOCOLPGM("Mean of sampled points: ");
841
-          SERIAL_PROTOCOL_F(mean, 8);
842
-          SERIAL_EOL();
843
-        }
844 836
       }
845 837
 
846 838
       // Create the matrix but don't correct the position yet
@@ -852,7 +844,7 @@ G29_TYPE GcodeSuite::G29() {
852 844
       // Show the Topography map if enabled
853 845
       if (do_topography_map) {
854 846
 
855
-        SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n"
847
+        SERIAL_ECHOLNPGM("\nBed Height Topography:\n"
856 848
                                "   +--- BACK --+\n"
857 849
                                "   |           |\n"
858 850
                                " L |    (+)    | R\n"
@@ -879,17 +871,17 @@ G29_TYPE GcodeSuite::G29() {
879 871
             NOMORE(min_diff, eqnBVector[ind] - z_tmp);
880 872
 
881 873
             if (diff >= 0.0)
882
-              SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
874
+              SERIAL_ECHOPGM(" +");   // Include + for column alignment
883 875
             else
884
-              SERIAL_PROTOCOLCHAR(' ');
885
-            SERIAL_PROTOCOL_F(diff, 5);
876
+              SERIAL_CHAR(' ');
877
+            SERIAL_ECHO_F(diff, 5);
886 878
           } // xx
887 879
           SERIAL_EOL();
888 880
         } // yy
889 881
         SERIAL_EOL();
890 882
 
891 883
         if (verbose_level > 3) {
892
-          SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:");
884
+          SERIAL_ECHOLNPGM("\nCorrected Bed Height vs. Bed Topology:");
893 885
 
894 886
           for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) {
895 887
             for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) {
@@ -902,11 +894,11 @@ G29_TYPE GcodeSuite::G29() {
902 894
 
903 895
               float diff = eqnBVector[ind] - z_tmp - min_diff;
904 896
               if (diff >= 0.0)
905
-                SERIAL_PROTOCOLPGM(" +");
897
+                SERIAL_ECHOPGM(" +");
906 898
               // Include + for column alignment
907 899
               else
908
-                SERIAL_PROTOCOLCHAR(' ');
909
-              SERIAL_PROTOCOL_F(diff, 5);
900
+                SERIAL_CHAR(' ');
901
+              SERIAL_ECHO_F(diff, 5);
910 902
             } // xx
911 903
             SERIAL_EOL();
912 904
           } // yy

+ 4
- 8
Marlin/src/gcode/bedlevel/abl/M421.cpp Прегледај датотеку

@@ -45,14 +45,10 @@ void GcodeSuite::M421() {
45 45
              hasZ = parser.seen('Z'),
46 46
              hasQ = !hasZ && parser.seen('Q');
47 47
 
48
-  if (!hasI || !hasJ || !(hasZ || hasQ)) {
49
-    SERIAL_ERROR_START();
50
-    SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
51
-  }
52
-  else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) {
53
-    SERIAL_ERROR_START();
54
-    SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY);
55
-  }
48
+  if (!hasI || !hasJ || !(hasZ || hasQ))
49
+    SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS);
50
+  else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))
51
+    SERIAL_ERROR_MSG(MSG_ERR_MESH_XY);
56 52
   else {
57 53
     z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0);
58 54
     #if ENABLED(ABL_BILINEAR_SUBDIVISION)

+ 12
- 12
Marlin/src/gcode/bedlevel/mbl/G29.cpp Прегледај датотеку

@@ -39,7 +39,7 @@
39 39
 #include "../../../module/stepper.h"
40 40
 
41 41
 // Save 130 bytes with non-duplication of PSTR
42
-inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_PROTOCOLLNPGM(" not entered."); }
42
+inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); }
43 43
 
44 44
 /**
45 45
  * G29: Mesh-based Z probe, probes a grid and produces a
@@ -64,7 +64,7 @@ void GcodeSuite::G29() {
64 64
 
65 65
   MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport);
66 66
   if (!WITHIN(state, 0, 5)) {
67
-    SERIAL_PROTOCOLLNPGM("S out of range (0-5).");
67
+    SERIAL_ECHOLNPGM("S out of range (0-5).");
68 68
     return;
69 69
   }
70 70
 
@@ -72,13 +72,13 @@ void GcodeSuite::G29() {
72 72
 
73 73
   switch (state) {
74 74
     case MeshReport:
75
-      SERIAL_PROTOCOLPGM("Mesh Bed Leveling ");
75
+      SERIAL_ECHOPGM("Mesh Bed Leveling ");
76 76
       if (leveling_is_valid()) {
77 77
         serialprintln_onoff(planner.leveling_active);
78 78
         mbl.report_mesh();
79 79
       }
80 80
       else
81
-        SERIAL_PROTOCOLLNPGM("has no data.");
81
+        SERIAL_ECHOLNPGM("has no data.");
82 82
       break;
83 83
 
84 84
     case MeshStart:
@@ -92,7 +92,7 @@ void GcodeSuite::G29() {
92 92
 
93 93
     case MeshNext:
94 94
       if (mbl_probe_index < 0) {
95
-        SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first.");
95
+        SERIAL_ECHOLNPGM("Start mesh probing with \"G29 S1\" first.");
96 96
         return;
97 97
       }
98 98
       // For each G29 S2...
@@ -130,7 +130,7 @@ void GcodeSuite::G29() {
130 130
 
131 131
         // After recording the last point, activate home and activate
132 132
         mbl_probe_index = -1;
133
-        SERIAL_PROTOCOLLNPGM("Mesh probing done.");
133
+        SERIAL_ECHOLNPGM("Mesh probing done.");
134 134
         BUZZ(100, 659);
135 135
         BUZZ(100, 698);
136 136
 
@@ -154,8 +154,8 @@ void GcodeSuite::G29() {
154 154
       if (parser.seenval('I')) {
155 155
         ix = parser.value_int();
156 156
         if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) {
157
-          SERIAL_PROTOCOLPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1));
158
-          SERIAL_PROTOCOLLNPGM(")");
157
+          SERIAL_ECHOPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1));
158
+          SERIAL_ECHOLNPGM(")");
159 159
           return;
160 160
         }
161 161
       }
@@ -165,8 +165,8 @@ void GcodeSuite::G29() {
165 165
       if (parser.seenval('J')) {
166 166
         iy = parser.value_int();
167 167
         if (!WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) {
168
-          SERIAL_PROTOCOLPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1));
169
-          SERIAL_PROTOCOLLNPGM(")");
168
+          SERIAL_ECHOPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1));
169
+          SERIAL_ECHOLNPGM(")");
170 170
           return;
171 171
         }
172 172
       }
@@ -193,8 +193,8 @@ void GcodeSuite::G29() {
193 193
   } // switch(state)
194 194
 
195 195
   if (state == MeshNext) {
196
-    SERIAL_PROTOCOLPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS));
197
-    SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS));
196
+    SERIAL_ECHOPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS));
197
+    SERIAL_ECHOLNPAIR(" of ", int(GRID_MAX_POINTS));
198 198
   }
199 199
 
200 200
   report_current_position();

+ 4
- 8
Marlin/src/gcode/bedlevel/mbl/M421.cpp Прегледај датотеку

@@ -48,14 +48,10 @@ void GcodeSuite::M421() {
48 48
   const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(parser.value_linear_units())) : -1;
49 49
   const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q');
50 50
 
51
-  if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) {
52
-    SERIAL_ERROR_START();
53
-    SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
54
-  }
55
-  else if (ix < 0 || iy < 0) {
56
-    SERIAL_ERROR_START();
57
-    SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY);
58
-  }
51
+  if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ))
52
+    SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS);
53
+  else if (ix < 0 || iy < 0)
54
+    SERIAL_ERROR_MSG(MSG_ERR_MESH_XY);
59 55
   else
60 56
     mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0));
61 57
 }

+ 4
- 8
Marlin/src/gcode/bedlevel/ubl/M421.cpp Прегледај датотеку

@@ -56,14 +56,10 @@ void GcodeSuite::M421() {
56 56
     iy = location.y_index;
57 57
   }
58 58
 
59
-  if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) {
60
-    SERIAL_ERROR_START();
61
-    SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
62
-  }
63
-  else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) {
64
-    SERIAL_ERROR_START();
65
-    SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY);
66
-  }
59
+  if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN))
60
+    SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS);
61
+  else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))
62
+    SERIAL_ERROR_MSG(MSG_ERR_MESH_XY);
67 63
   else
68 64
     ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0);
69 65
 }

+ 1
- 1
Marlin/src/gcode/bedlevel/ubl/M49.cpp Прегледај датотеку

@@ -33,7 +33,7 @@
33 33
 
34 34
 void GcodeSuite::M49() {
35 35
   g26_debug_flag ^= true;
36
-  SERIAL_PROTOCOLPGM("G26 Debug: ");
36
+  SERIAL_ECHOPGM("G26 Debug: ");
37 37
   serialprintPGM(g26_debug_flag ? PSTR("On\n") : PSTR("Off\n"));
38 38
 }
39 39
 

+ 2
- 4
Marlin/src/gcode/calibrate/G28.cpp Прегледај датотеку

@@ -92,8 +92,7 @@
92 92
     // Disallow Z homing if X or Y are unknown
93 93
     if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) {
94 94
       LCD_MESSAGEPGM(MSG_ERR_Z_HOMING);
95
-      SERIAL_ECHO_START();
96
-      SERIAL_ECHOLNPGM(MSG_ERR_Z_HOMING);
95
+      SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING);
97 96
       return;
98 97
     }
99 98
 
@@ -135,8 +134,7 @@
135 134
     }
136 135
     else {
137 136
       LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
138
-      SERIAL_ECHO_START();
139
-      SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT);
137
+      SERIAL_ECHO_MSG(MSG_ZPROBE_OUT);
140 138
     }
141 139
 
142 140
     #if ENABLED(DEBUG_LEVELING_FEATURE)

+ 28
- 33
Marlin/src/gcode/calibrate/G33.cpp Прегледај датотеку

@@ -109,28 +109,28 @@ void ac_cleanup(
109 109
 }
110 110
 
111 111
 void print_signed_float(PGM_P const prefix, const float &f) {
112
-  SERIAL_PROTOCOLPGM("  ");
112
+  SERIAL_ECHOPGM("  ");
113 113
   serialprintPGM(prefix);
114
-  SERIAL_PROTOCOLCHAR(':');
114
+  SERIAL_CHAR(':');
115 115
   if (f >= 0) SERIAL_CHAR('+');
116
-  SERIAL_PROTOCOL_F(f, 2);
116
+  SERIAL_ECHO_F(f, 2);
117 117
 }
118 118
 
119 119
 /**
120 120
  *  - Print the delta settings
121 121
  */
122 122
 static void print_calibration_settings(const bool end_stops, const bool tower_angles) {
123
-  SERIAL_PROTOCOLPAIR(".Height:", delta_height);
123
+  SERIAL_ECHOPAIR(".Height:", delta_height);
124 124
   if (end_stops) {
125 125
     print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
126 126
     print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
127 127
     print_signed_float(PSTR("Ez"), delta_endstop_adj[C_AXIS]);
128 128
   }
129 129
   if (end_stops && tower_angles) {
130
-    SERIAL_PROTOCOLPAIR("  Radius:", delta_radius);
130
+    SERIAL_ECHOPAIR("  Radius:", delta_radius);
131 131
     SERIAL_EOL();
132 132
     SERIAL_CHAR('.');
133
-    SERIAL_PROTOCOL_SP(13);
133
+    SERIAL_ECHO_SP(13);
134 134
   }
135 135
   if (tower_angles) {
136 136
     print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]);
@@ -138,11 +138,11 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an
138 138
     print_signed_float(PSTR("Tz"), delta_tower_angle_trim[C_AXIS]);
139 139
   }
140 140
   if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR
141
-    SERIAL_PROTOCOLPAIR("  Radius:", delta_radius);
141
+    SERIAL_ECHOPAIR("  Radius:", delta_radius);
142 142
   }
143 143
   #if HAS_BED_PROBE
144 144
     if (!end_stops && !tower_angles) {
145
-      SERIAL_PROTOCOL_SP(30);
145
+      SERIAL_ECHO_SP(30);
146 146
       print_signed_float(PSTR("Offset"), zprobe_zoffset);
147 147
     }
148 148
   #endif
@@ -153,7 +153,7 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an
153 153
  *  - Print the probe results
154 154
  */
155 155
 static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) {
156
-  SERIAL_PROTOCOLPGM(".    ");
156
+  SERIAL_ECHOPGM(".    ");
157 157
   print_signed_float(PSTR("c"), z_pt[CEN]);
158 158
   if (tower_points) {
159 159
     print_signed_float(PSTR(" x"), z_pt[__A]);
@@ -163,7 +163,7 @@ static void print_calibration_results(const float z_pt[NPP + 1], const bool towe
163 163
   if (tower_points && opposite_points) {
164 164
     SERIAL_EOL();
165 165
     SERIAL_CHAR('.');
166
-    SERIAL_PROTOCOL_SP(13);
166
+    SERIAL_ECHO_SP(13);
167 167
   }
168 168
   if (opposite_points) {
169 169
     print_signed_float(PSTR("yz"), z_pt[_BC]);
@@ -438,7 +438,7 @@ void GcodeSuite::G33() {
438 438
 
439 439
   const int8_t probe_points = set_up ? 2 : parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
440 440
   if (!WITHIN(probe_points, -1, 10)) {
441
-    SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (-1 - 10).");
441
+    SERIAL_ECHOLNPGM("?(P)oints is implausible (-1 - 10).");
442 442
     return;
443 443
   }
444 444
 
@@ -446,19 +446,19 @@ void GcodeSuite::G33() {
446 446
 
447 447
   const float calibration_precision = set_up ? Z_CLEARANCE_BETWEEN_PROBES / 5.0 : parser.floatval('C', 0.0);
448 448
   if (calibration_precision < 0) {
449
-    SERIAL_PROTOCOLLNPGM("?(C)alibration precision is implausible (>=0).");
449
+    SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0).");
450 450
     return;
451 451
   }
452 452
 
453 453
   const int8_t force_iterations = parser.intval('F', 0);
454 454
   if (!WITHIN(force_iterations, 0, 30)) {
455
-    SERIAL_PROTOCOLLNPGM("?(F)orce iteration is implausible (0 - 30).");
455
+    SERIAL_ECHOLNPGM("?(F)orce iteration is implausible (0 - 30).");
456 456
     return;
457 457
   }
458 458
 
459 459
   const int8_t verbose_level = parser.byteval('V', 1);
460 460
   if (!WITHIN(verbose_level, 0, 3)) {
461
-    SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0 - 3).");
461
+    SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0 - 3).");
462 462
     return;
463 463
   }
464 464
 
@@ -503,14 +503,14 @@ void GcodeSuite::G33() {
503 503
           delta_tower_angle_trim[C_AXIS]
504 504
         };
505 505
 
506
-  SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");
506
+  SERIAL_ECHOLNPGM("G33 Auto Calibrate");
507 507
 
508 508
   if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable
509 509
     LOOP_CAL_RAD(axis) {
510 510
       const float a = RADIANS(210 + (360 / NPP) *  (axis - 1)),
511 511
                   r = delta_calibration_radius;
512 512
       if (!position_is_reachable(cos(a) * r, sin(a) * r)) {
513
-        SERIAL_PROTOCOLLNPGM("?(M665 B)ed radius is implausible.");
513
+        SERIAL_ECHOLNPGM("?(M665 B)ed radius is implausible.");
514 514
         return;
515 515
       }
516 516
     }
@@ -519,8 +519,8 @@ void GcodeSuite::G33() {
519 519
   // Report settings
520 520
   PGM_P checkingac = PSTR("Checking... AC");
521 521
   serialprintPGM(checkingac);
522
-  if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)");
523
-  if (set_up) SERIAL_PROTOCOLPGM("  (SET-UP)");
522
+  if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)");
523
+  if (set_up) SERIAL_ECHOPGM("  (SET-UP)");
524 524
   SERIAL_EOL();
525 525
   ui.set_status_P(checkingac);
526 526
 
@@ -540,7 +540,7 @@ void GcodeSuite::G33() {
540 540
     // Probe the points
541 541
     zero_std_dev_old = zero_std_dev;
542 542
     if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each, set_up)) {
543
-      SERIAL_PROTOCOLLNPGM("Correct delta settings with M665 and M666");
543
+      SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666");
544 544
       return AC_CLEANUP();
545 545
     }
546 546
     zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points);
@@ -665,16 +665,15 @@ void GcodeSuite::G33() {
665 665
 
666 666
     if (verbose_level != 0) { // !dry run
667 667
       if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations
668
-        SERIAL_PROTOCOLPGM("Calibration OK");
669
-        SERIAL_PROTOCOL_SP(32);
668
+        SERIAL_ECHOPGM("Calibration OK");
669
+        SERIAL_ECHO_SP(32);
670 670
         #if HAS_BED_PROBE
671 671
           if (zero_std_dev >= test_precision && !_1p_calibration && !_0p_calibration)
672
-            SERIAL_PROTOCOLPGM("rolling back.");
672
+            SERIAL_ECHOPGM("rolling back.");
673 673
           else
674 674
         #endif
675 675
           {
676
-            SERIAL_PROTOCOLPGM("std dev:");
677
-            SERIAL_PROTOCOL_F(zero_std_dev_min, 3);
676
+            SERIAL_ECHOPAIR_F("std dev:", zero_std_dev_min, 3);
678 677
           }
679 678
         SERIAL_EOL();
680 679
         char mess[21];
@@ -694,11 +693,9 @@ void GcodeSuite::G33() {
694 693
           sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
695 694
         else
696 695
           strcpy_P(mess, PSTR("No convergence"));
697
-        SERIAL_PROTOCOL(mess);
698
-        SERIAL_PROTOCOL_SP(32);
699
-        SERIAL_PROTOCOLPGM("std dev:");
700
-        SERIAL_PROTOCOL_F(zero_std_dev, 3);
701
-        SERIAL_EOL();
696
+        SERIAL_ECHO(mess);
697
+        SERIAL_ECHO_SP(32);
698
+        SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3);
702 699
         ui.set_status(mess);
703 700
         if (verbose_level > 1)
704 701
           print_calibration_settings(_endstop_results, _angle_results);
@@ -707,10 +704,8 @@ void GcodeSuite::G33() {
707 704
     else { // dry run
708 705
       PGM_P enddryrun = PSTR("End DRY-RUN");
709 706
       serialprintPGM(enddryrun);
710
-      SERIAL_PROTOCOL_SP(35);
711
-      SERIAL_PROTOCOLPGM("std dev:");
712
-      SERIAL_PROTOCOL_F(zero_std_dev, 3);
713
-      SERIAL_EOL();
707
+      SERIAL_ECHO_SP(35);
708
+      SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3);
714 709
 
715 710
       char mess[21];
716 711
       strcpy_P(mess, enddryrun);

+ 3
- 3
Marlin/src/gcode/calibrate/G34_M422.cpp Прегледај датотеку

@@ -263,19 +263,19 @@ void GcodeSuite::G34() {
263 263
 void GcodeSuite::M422() {
264 264
   const int8_t zstepper = parser.intval('S') - 1;
265 265
   if (!WITHIN(zstepper, 0, Z_STEPPER_COUNT - 1)) {
266
-    SERIAL_PROTOCOLLNPGM("?(S) Z-Stepper index invalid.");
266
+    SERIAL_ECHOLNPGM("?(S) Z-Stepper index invalid.");
267 267
     return;
268 268
   }
269 269
 
270 270
   const float x_pos = parser.floatval('X', z_auto_align_xpos[zstepper]);
271 271
   if (!WITHIN(x_pos, X_MIN_POS, X_MAX_POS)) {
272
-    SERIAL_PROTOCOLLNPGM("?(X) out of bounds.");
272
+    SERIAL_ECHOLNPGM("?(X) out of bounds.");
273 273
     return;
274 274
   }
275 275
 
276 276
   const float y_pos = parser.floatval('Y', z_auto_align_ypos[zstepper]);
277 277
   if (!WITHIN(y_pos, Y_MIN_POS, Y_MAX_POS)) {
278
-    SERIAL_PROTOCOLLNPGM("?(Y) out of bounds.");
278
+    SERIAL_ECHOLNPGM("?(Y) out of bounds.");
279 279
     return;
280 280
   }
281 281
 

+ 21
- 35
Marlin/src/gcode/calibrate/M48.cpp Прегледај датотеку

@@ -55,16 +55,16 @@ void GcodeSuite::M48() {
55 55
 
56 56
   const int8_t verbose_level = parser.byteval('V', 1);
57 57
   if (!WITHIN(verbose_level, 0, 4)) {
58
-    SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).");
58
+    SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4).");
59 59
     return;
60 60
   }
61 61
 
62 62
   if (verbose_level > 0)
63
-    SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability Test");
63
+    SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test");
64 64
 
65 65
   const int8_t n_samples = parser.byteval('P', 10);
66 66
   if (!WITHIN(n_samples, 4, 50)) {
67
-    SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50).");
67
+    SERIAL_ECHOLNPGM("?Sample size not plausible (4-50).");
68 68
     return;
69 69
   }
70 70
 
@@ -77,14 +77,14 @@ void GcodeSuite::M48() {
77 77
               Y_probe_location = parser.linearval('Y', Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER);
78 78
 
79 79
   if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) {
80
-    SERIAL_PROTOCOLLNPGM("? (X,Y) out of bounds.");
80
+    SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
81 81
     return;
82 82
   }
83 83
 
84 84
   bool seen_L = parser.seen('L');
85 85
   uint8_t n_legs = seen_L ? parser.value_byte() : 0;
86 86
   if (n_legs > 15) {
87
-    SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15).");
87
+    SERIAL_ECHOLNPGM("?Number of legs in movement not plausible (0-15).");
88 88
     return;
89 89
   }
90 90
   if (n_legs == 1) n_legs = 2;
@@ -98,7 +98,7 @@ void GcodeSuite::M48() {
98 98
    * we don't want to use that as a starting point for each probe.
99 99
    */
100 100
   if (verbose_level > 2)
101
-    SERIAL_PROTOCOLLNPGM("Positioning the probe...");
101
+    SERIAL_ECHOLNPGM("Positioning the probe...");
102 102
 
103 103
   // Disable bed level correction in M48 because we want the raw data when we probe
104 104
 
@@ -178,7 +178,7 @@ void GcodeSuite::M48() {
178 178
             }
179 179
           #endif
180 180
           if (verbose_level > 3) {
181
-            SERIAL_PROTOCOLPGM("Going to:");
181
+            SERIAL_ECHOPGM("Going to:");
182 182
             SERIAL_ECHOPAIR(" X", X_current);
183 183
             SERIAL_ECHOPAIR(" Y", Y_current);
184 184
             SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]);
@@ -215,22 +215,15 @@ void GcodeSuite::M48() {
215 215
       sigma = SQRT(sum / (n + 1));
216 216
       if (verbose_level > 0) {
217 217
         if (verbose_level > 1) {
218
-          SERIAL_PROTOCOL(n + 1);
219
-          SERIAL_PROTOCOLPGM(" of ");
220
-          SERIAL_PROTOCOL((int)n_samples);
221
-          SERIAL_PROTOCOLPGM(": z: ");
222
-          SERIAL_PROTOCOL_F(sample_set[n], 3);
218
+          SERIAL_ECHO(n + 1);
219
+          SERIAL_ECHOPAIR(" of ", (int)n_samples);
220
+          SERIAL_ECHOPAIR_F(": z: ", sample_set[n], 3);
223 221
           if (verbose_level > 2) {
224
-            SERIAL_PROTOCOLPGM(" mean: ");
225
-            SERIAL_PROTOCOL_F(mean, 4);
226
-            SERIAL_PROTOCOLPGM(" sigma: ");
227
-            SERIAL_PROTOCOL_F(sigma, 6);
228
-            SERIAL_PROTOCOLPGM(" min: ");
229
-            SERIAL_PROTOCOL_F(min, 3);
230
-            SERIAL_PROTOCOLPGM(" max: ");
231
-            SERIAL_PROTOCOL_F(max, 3);
232
-            SERIAL_PROTOCOLPGM(" range: ");
233
-            SERIAL_PROTOCOL_F(max-min, 3);
222
+            SERIAL_ECHOPAIR_F(" mean: ", mean, 4);
223
+            SERIAL_ECHOPAIR_F(" sigma: ", sigma, 6);
224
+            SERIAL_ECHOPAIR_F(" min: ", min, 3);
225
+            SERIAL_ECHOPAIR_F(" max: ", max, 3);
226
+            SERIAL_ECHOPAIR_F(" range: ", max-min, 3);
234 227
           }
235 228
           SERIAL_EOL();
236 229
         }
@@ -242,23 +235,16 @@ void GcodeSuite::M48() {
242 235
   STOW_PROBE();
243 236
 
244 237
   if (probing_good) {
245
-    SERIAL_PROTOCOLLNPGM("Finished!");
238
+    SERIAL_ECHOLNPGM("Finished!");
246 239
 
247 240
     if (verbose_level > 0) {
248
-      SERIAL_PROTOCOLPGM("Mean: ");
249
-      SERIAL_PROTOCOL_F(mean, 6);
250
-      SERIAL_PROTOCOLPGM(" Min: ");
251
-      SERIAL_PROTOCOL_F(min, 3);
252
-      SERIAL_PROTOCOLPGM(" Max: ");
253
-      SERIAL_PROTOCOL_F(max, 3);
254
-      SERIAL_PROTOCOLPGM(" Range: ");
255
-      SERIAL_PROTOCOL_F(max-min, 3);
256
-      SERIAL_EOL();
241
+      SERIAL_ECHOPAIR_F("Mean: ", mean, 6);
242
+      SERIAL_ECHOPAIR_F(" Min: ", min, 3);
243
+      SERIAL_ECHOPAIR_F(" Max: ", max, 3);
244
+      SERIAL_ECHOLNPAIR_F(" Range: ", max-min, 3);
257 245
     }
258 246
 
259
-    SERIAL_PROTOCOLPGM("Standard Deviation: ");
260
-    SERIAL_PROTOCOL_F(sigma, 6);
261
-    SERIAL_EOL();
247
+    SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6);
262 248
     SERIAL_EOL();
263 249
   }
264 250
 

+ 2
- 4
Marlin/src/gcode/calibrate/M665.cpp Прегледај датотеку

@@ -84,8 +84,7 @@
84 84
         if (sumAPX == 1)
85 85
           scara_home_offset[A_AXIS] = parser.value_float();
86 86
         else {
87
-          SERIAL_ERROR_START();
88
-          SERIAL_ERRORLNPGM("Only one of A, P, or X is allowed.");
87
+          SERIAL_ERROR_MSG("Only one of A, P, or X is allowed.");
89 88
           return;
90 89
         }
91 90
       }
@@ -96,8 +95,7 @@
96 95
         if (sumBTY == 1)
97 96
           scara_home_offset[B_AXIS] = parser.value_float();
98 97
         else {
99
-          SERIAL_ERROR_START();
100
-          SERIAL_ERRORLNPGM("Only one of B, T, or Y is allowed.");
98
+          SERIAL_ERROR_MSG("Only one of B, T, or Y is allowed.");
101 99
           return;
102 100
         }
103 101
       }

+ 1
- 3
Marlin/src/gcode/calibrate/M852.cpp Прегледај датотеку

@@ -93,9 +93,7 @@ void GcodeSuite::M852() {
93 93
 
94 94
   if (!ijk) {
95 95
     SERIAL_ECHO_START();
96
-    SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: ");
97
-    SERIAL_ECHO_F(planner.skew_factor.xy, 6);
98
-    SERIAL_EOL();
96
+    SERIAL_ECHOLNPAIR_F(MSG_SKEW_FACTOR " XY: ", planner.skew_factor.xy, 6);
99 97
     #if ENABLED(SKEW_CORRECTION_FOR_Z)
100 98
       SERIAL_ECHOPAIR(" XZ: ", planner.skew_factor.xz);
101 99
       SERIAL_ECHOLNPAIR(" YZ: ", planner.skew_factor.yz);

+ 2
- 4
Marlin/src/gcode/config/M200-M205.cpp Прегледај датотеку

@@ -147,10 +147,8 @@ void GcodeSuite::M205() {
147 147
           planner.recalculate_max_e_jerk();
148 148
         #endif
149 149
       }
150
-      else {
151
-        SERIAL_ERROR_START();
152
-        SERIAL_ERRORLNPGM("?J out of range (0.01 to 0.3)");
153
-      }
150
+      else
151
+        SERIAL_ERROR_MSG("?J out of range (0.01 to 0.3)");
154 152
     }
155 153
   #endif
156 154
   #if HAS_CLASSIC_JERK

+ 2
- 4
Marlin/src/gcode/config/M301.cpp Прегледај датотеку

@@ -70,10 +70,8 @@ void GcodeSuite::M301() {
70 70
     #endif
71 71
     SERIAL_EOL();
72 72
   }
73
-  else {
74
-    SERIAL_ERROR_START();
75
-    SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER);
76
-  }
73
+  else
74
+    SERIAL_ERROR_MSG(MSG_INVALID_EXTRUDER);
77 75
 }
78 76
 
79 77
 #endif // PIDTEMP

+ 32
- 34
Marlin/src/gcode/config/M43.cpp Прегледај датотеку

@@ -89,22 +89,20 @@ inline void toggle_pins() {
89 89
 inline void servo_probe_test() {
90 90
   #if !(NUM_SERVOS > 0 && HAS_SERVO_0)
91 91
 
92
-    SERIAL_ERROR_START();
93
-    SERIAL_ERRORLNPGM("SERVO not setup");
92
+    SERIAL_ERROR_MSG("SERVO not setup");
94 93
 
95 94
   #elif !HAS_Z_SERVO_PROBE
96 95
 
97
-    SERIAL_ERROR_START();
98
-    SERIAL_ERRORLNPGM("Z_PROBE_SERVO_NR not setup");
96
+    SERIAL_ERROR_MSG("Z_PROBE_SERVO_NR not setup");
99 97
 
100 98
   #else // HAS_Z_SERVO_PROBE
101 99
 
102 100
     const uint8_t probe_index = parser.byteval('P', Z_PROBE_SERVO_NR);
103 101
 
104
-    SERIAL_PROTOCOLLNPGM("Servo probe test");
105
-    SERIAL_PROTOCOLLNPAIR(".  using index:  ", probe_index);
106
-    SERIAL_PROTOCOLLNPAIR(".  deploy angle: ", servo_angles[probe_index][0]);
107
-    SERIAL_PROTOCOLLNPAIR(".  stow angle:   ", servo_angles[probe_index][1]);
102
+    SERIAL_ECHOLNPGM("Servo probe test");
103
+    SERIAL_ECHOLNPAIR(".  using index:  ", probe_index);
104
+    SERIAL_ECHOLNPAIR(".  deploy angle: ", servo_angles[probe_index][0]);
105
+    SERIAL_ECHOLNPAIR(".  stow angle:   ", servo_angles[probe_index][1]);
108 106
 
109 107
     bool probe_inverting;
110 108
 
@@ -112,14 +110,14 @@ inline void servo_probe_test() {
112 110
 
113 111
       #define PROBE_TEST_PIN Z_MIN_PIN
114 112
 
115
-      SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN);
116
-      SERIAL_PROTOCOLLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)");
117
-      SERIAL_PROTOCOLPGM(". Z_MIN_ENDSTOP_INVERTING: ");
113
+      SERIAL_ECHOLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN);
114
+      SERIAL_ECHOLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)");
115
+      SERIAL_ECHOPGM(". Z_MIN_ENDSTOP_INVERTING: ");
118 116
 
119 117
       #if Z_MIN_ENDSTOP_INVERTING
120
-        SERIAL_PROTOCOLLNPGM("true");
118
+        SERIAL_ECHOLNPGM("true");
121 119
       #else
122
-        SERIAL_PROTOCOLLNPGM("false");
120
+        SERIAL_ECHOLNPGM("false");
123 121
       #endif
124 122
 
125 123
       probe_inverting = Z_MIN_ENDSTOP_INVERTING;
@@ -127,21 +125,21 @@ inline void servo_probe_test() {
127 125
     #elif ENABLED(Z_MIN_PROBE_ENDSTOP)
128 126
 
129 127
       #define PROBE_TEST_PIN Z_MIN_PROBE_PIN
130
-      SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN);
131
-      SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)");
132
-      SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: ");
128
+      SERIAL_ECHOLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN);
129
+      SERIAL_ECHOLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)");
130
+      SERIAL_ECHOPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: ");
133 131
 
134 132
       #if Z_MIN_PROBE_ENDSTOP_INVERTING
135
-        SERIAL_PROTOCOLLNPGM("true");
133
+        SERIAL_ECHOLNPGM("true");
136 134
       #else
137
-        SERIAL_PROTOCOLLNPGM("false");
135
+        SERIAL_ECHOLNPGM("false");
138 136
       #endif
139 137
 
140 138
       probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING;
141 139
 
142 140
     #endif
143 141
 
144
-    SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times");
142
+    SERIAL_ECHOLNPGM(". deploy & stow 4 times");
145 143
     SET_INPUT_PULLUP(PROBE_TEST_PIN);
146 144
     uint8_t i = 0;
147 145
     bool deploy_state, stow_state;
@@ -153,26 +151,26 @@ inline void servo_probe_test() {
153 151
       safe_delay(500);
154 152
       stow_state = READ(PROBE_TEST_PIN);
155 153
     } while (++i < 4);
156
-    if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
154
+    if (probe_inverting != deploy_state) SERIAL_ECHOLNPGM("WARNING - INVERTING setting probably backwards");
157 155
 
158 156
     if (deploy_state != stow_state) {
159
-      SERIAL_PROTOCOLLNPGM("BLTouch clone detected");
157
+      SERIAL_ECHOLNPGM("BLTouch clone detected");
160 158
       if (deploy_state) {
161
-        SERIAL_PROTOCOLLNPGM(".  DEPLOYED state: HIGH (logic 1)");
162
-        SERIAL_PROTOCOLLNPGM(".  STOWED (triggered) state: LOW (logic 0)");
159
+        SERIAL_ECHOLNPGM(".  DEPLOYED state: HIGH (logic 1)");
160
+        SERIAL_ECHOLNPGM(".  STOWED (triggered) state: LOW (logic 0)");
163 161
       }
164 162
       else {
165
-        SERIAL_PROTOCOLLNPGM(".  DEPLOYED state: LOW (logic 0)");
166
-        SERIAL_PROTOCOLLNPGM(".  STOWED (triggered) state: HIGH (logic 1)");
163
+        SERIAL_ECHOLNPGM(".  DEPLOYED state: LOW (logic 0)");
164
+        SERIAL_ECHOLNPGM(".  STOWED (triggered) state: HIGH (logic 1)");
167 165
       }
168 166
       #if ENABLED(BLTOUCH)
169
-        SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true.");
167
+        SERIAL_ECHOLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true.");
170 168
       #endif
171 169
     }
172 170
     else {                                           // measure active signal length
173 171
       MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy
174 172
       safe_delay(500);
175
-      SERIAL_PROTOCOLLNPGM("please trigger probe");
173
+      SERIAL_ECHOLNPGM("please trigger probe");
176 174
       uint16_t probe_counter = 0;
177 175
 
178 176
       // Allow 30 seconds max for operator to trigger probe
@@ -188,11 +186,11 @@ inline void servo_probe_test() {
188 186
             safe_delay(2);
189 187
 
190 188
           if (probe_counter == 50)
191
-            SERIAL_PROTOCOLLNPGM("Z Servo Probe detected"); // >= 100mS active time
189
+            SERIAL_ECHOLNPGM("Z Servo Probe detected"); // >= 100mS active time
192 190
           else if (probe_counter >= 2)
193
-            SERIAL_PROTOCOLLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse
191
+            SERIAL_ECHOLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse
194 192
           else
195
-            SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse
193
+            SERIAL_ECHOLNPGM("noise detected - please re-run test"); // less than 2mS pulse
196 194
 
197 195
           MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][1]); // Stow
198 196
 
@@ -200,7 +198,7 @@ inline void servo_probe_test() {
200 198
 
201 199
       } // for loop waiting for trigger
202 200
 
203
-      if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected");
201
+      if (probe_counter == 0) SERIAL_ECHOLNPGM("trigger not detected");
204 202
 
205 203
     } // measure active signal length
206 204
 
@@ -245,9 +243,9 @@ void GcodeSuite::M43() {
245 243
   // Enable or disable endstop monitoring
246 244
   if (parser.seen('E')) {
247 245
     endstops.monitor_flag = parser.value_bool();
248
-    SERIAL_PROTOCOLPGM("endstop monitor ");
246
+    SERIAL_ECHOPGM("endstop monitor ");
249 247
     serialprintPGM(endstops.monitor_flag ? PSTR("en") : PSTR("dis"));
250
-    SERIAL_PROTOCOLLNPGM("abled");
248
+    SERIAL_ECHOLNPGM("abled");
251 249
     return;
252 250
   }
253 251
 
@@ -266,7 +264,7 @@ void GcodeSuite::M43() {
266 264
 
267 265
   // Watch until click, M108, or reset
268 266
   if (parser.boolval('W')) {
269
-    SERIAL_PROTOCOLLNPGM("Watching pins");
267
+    SERIAL_ECHOLNPGM("Watching pins");
270 268
 
271 269
     #ifdef ARDUINO_ARCH_SAM
272 270
       NOLESS(first_pin, 2);  // don't hijack the UART pins

+ 2
- 4
Marlin/src/gcode/eeprom/M500-M504.cpp Прегледај датотеку

@@ -94,9 +94,7 @@ void GcodeSuite::M502() {
94 94
    * M504: Validate EEPROM Contents
95 95
    */
96 96
   void GcodeSuite::M504() {
97
-    if (settings.validate(CHAT_PORT)) {
98
-      SERIAL_ECHO_START_P(command_queue_port[cmd_queue_index_r]);
99
-      SERIAL_ECHOLNPGM_P(command_queue_port[cmd_queue_index_r], "EEPROM OK");
100
-    }
97
+    if (settings.validate(CHAT_PORT))
98
+      SERIAL_ECHO_MSG_P(command_queue_port[cmd_queue_index_r], "EEPROM OK");
101 99
   }
102 100
 #endif

+ 2
- 2
Marlin/src/gcode/feature/advance/M900.cpp Прегледај датотеку

@@ -40,7 +40,7 @@ void GcodeSuite::M900() {
40 40
   #else
41 41
     const uint8_t tmp_extruder = parser.seenval('T') ? parser.value_int() : active_extruder;
42 42
     if (tmp_extruder >= EXTRUDERS) {
43
-      SERIAL_PROTOCOLLNPGM("?T value out of range.");
43
+      SERIAL_ECHOLNPGM("?T value out of range.");
44 44
       return;
45 45
     }
46 46
   #endif
@@ -52,7 +52,7 @@ void GcodeSuite::M900() {
52 52
       planner.extruder_advance_K[tmp_extruder] = newK;
53 53
     }
54 54
     else
55
-      SERIAL_PROTOCOLLNPGM("?K value out of range (0-10).");
55
+      SERIAL_ECHOLNPGM("?K value out of range (0-10).");
56 56
   }
57 57
   else {
58 58
     SERIAL_ECHO_START();

+ 1
- 2
Marlin/src/gcode/feature/caselight/M355.cpp Прегледај датотеку

@@ -63,7 +63,6 @@ void GcodeSuite::M355() {
63 63
       else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness);
64 64
     }
65 65
   #else
66
-    SERIAL_ERROR_START();
67
-    SERIAL_ERRORLNPGM(MSG_ERR_M355_NONE);
66
+    SERIAL_ERROR_MSG(MSG_ERR_M355_NONE);
68 67
   #endif
69 68
 }

+ 3
- 6
Marlin/src/gcode/feature/filwidth/M404-M407.cpp Прегледај датотеку

@@ -38,10 +38,8 @@ void GcodeSuite::M404() {
38 38
     filament_width_nominal = parser.value_linear_units();
39 39
     planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5);
40 40
   }
41
-  else {
42
-    SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
43
-    SERIAL_PROTOCOLLN(filament_width_nominal);
44
-  }
41
+  else
42
+    SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filament_width_nominal);
45 43
 }
46 44
 
47 45
 /**
@@ -79,8 +77,7 @@ void GcodeSuite::M406() {
79 77
  * M407: Get measured filament diameter on serial output
80 78
  */
81 79
 void GcodeSuite::M407() {
82
-  SERIAL_PROTOCOLPGM("Filament dia (measured mm):");
83
-  SERIAL_PROTOCOLLN(filament_width_meas);
80
+  SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filament_width_meas);
84 81
 }
85 82
 
86 83
 #endif // FILAMENT_WIDTH_SENSOR

+ 3
- 6
Marlin/src/gcode/feature/i2c/M260_M261.cpp Прегледај датотеку

@@ -68,13 +68,10 @@ void GcodeSuite::M261() {
68 68
 
69 69
   uint8_t bytes = parser.byteval('B', 1);
70 70
 
71
-  if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) {
71
+  if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE)
72 72
     i2c.relay(bytes);
73
-  }
74
-  else {
75
-    SERIAL_ERROR_START();
76
-    SERIAL_ERRORLNPGM("Bad i2c request");
77
-  }
73
+  else
74
+    SERIAL_ERROR_MSG("Bad i2c request");
78 75
 }
79 76
 
80 77
 #endif

+ 2
- 4
Marlin/src/gcode/feature/macro/M810-M819.cpp Прегледај датотеку

@@ -45,10 +45,8 @@ void GcodeSuite::M810_819() {
45 45
 
46 46
   if (len) {
47 47
     // Set a macro
48
-    if (len > GCODE_MACROS_SLOT_SIZE) {
49
-      SERIAL_ERROR_START();
50
-      SERIAL_ERRORLNPGM("Macro too long.");
51
-    }
48
+    if (len > GCODE_MACROS_SLOT_SIZE)
49
+      SERIAL_ERROR_MSG("Macro too long.");
52 50
     else {
53 51
       char c, *s = parser.string_arg, *d = gcode_macros[index];
54 52
       do {

+ 3
- 6
Marlin/src/gcode/gcode.cpp Прегледај датотеку

@@ -790,16 +790,13 @@ void GcodeSuite::process_next_command() {
790 790
       switch (busy_state) {
791 791
         case IN_HANDLER:
792 792
         case IN_PROCESS:
793
-          SERIAL_ECHO_START();
794
-          SERIAL_ECHOLNPGM(MSG_BUSY_PROCESSING);
793
+          SERIAL_ECHO_MSG(MSG_BUSY_PROCESSING);
795 794
           break;
796 795
         case PAUSED_FOR_USER:
797
-          SERIAL_ECHO_START();
798
-          SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_USER);
796
+          SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_USER);
799 797
           break;
800 798
         case PAUSED_FOR_INPUT:
801
-          SERIAL_ECHO_START();
802
-          SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT);
799
+          SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_INPUT);
803 800
           break;
804 801
         default:
805 802
           break;

+ 1
- 1
Marlin/src/gcode/geometry/G53-G59.cpp Прегледај датотеку

@@ -80,7 +80,7 @@ inline void GcodeSuite::G53() {
80 80
 void G54_59(uint8_t subcode=0) {
81 81
   const int8_t _space = parser.codenum - 54 + subcode;
82 82
   if (gcode.select_coordinate_system(_space)) {
83
-    SERIAL_PROTOCOLLNPAIR("Select workspace ", _space);
83
+    SERIAL_ECHOLNPAIR("Select workspace ", _space);
84 84
     report_current_position();
85 85
   }
86 86
 }

+ 1
- 2
Marlin/src/gcode/geometry/M206_M428.cpp Прегледај датотеку

@@ -69,8 +69,7 @@ void GcodeSuite::M428() {
69 69
     if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0)
70 70
       diff[i] = -current_position[i];
71 71
     if (!WITHIN(diff[i], -20, 20)) {
72
-      SERIAL_ERROR_START();
73
-      SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR);
72
+      SERIAL_ERROR_MSG(MSG_ERR_M428_TOO_FAR);
74 73
       LCD_ALERTMESSAGEPGM("Err: Too far!");
75 74
       BUZZ(200, 40);
76 75
       return;

+ 12
- 12
Marlin/src/gcode/host/M114.cpp Прегледај датотеку

@@ -34,7 +34,7 @@
34 34
       SERIAL_CHAR(' ');
35 35
       SERIAL_CHAR(axis_codes[i]);
36 36
       SERIAL_CHAR(':');
37
-      SERIAL_PROTOCOL(dtostrf(pos[i], 8, precision, str));
37
+      SERIAL_ECHO(dtostrf(pos[i], 8, precision, str));
38 38
     }
39 39
     SERIAL_EOL();
40 40
   }
@@ -43,7 +43,7 @@
43 43
 
44 44
   void report_current_position_detail() {
45 45
 
46
-    SERIAL_PROTOCOLPGM("\nLogical:");
46
+    SERIAL_ECHOPGM("\nLogical:");
47 47
     const float logical[XYZ] = {
48 48
       LOGICAL_X_POSITION(current_position[X_AXIS]),
49 49
       LOGICAL_Y_POSITION(current_position[Y_AXIS]),
@@ -51,17 +51,17 @@
51 51
     };
52 52
     report_xyz(logical);
53 53
 
54
-    SERIAL_PROTOCOLPGM("Raw:    ");
54
+    SERIAL_ECHOPGM("Raw:    ");
55 55
     report_xyz(current_position);
56 56
 
57 57
     float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] };
58 58
 
59 59
     #if HAS_LEVELING
60
-      SERIAL_PROTOCOLPGM("Leveled:");
60
+      SERIAL_ECHOPGM("Leveled:");
61 61
       planner.apply_leveling(leveled);
62 62
       report_xyz(leveled);
63 63
 
64
-      SERIAL_PROTOCOLPGM("UnLevel:");
64
+      SERIAL_ECHOPGM("UnLevel:");
65 65
       float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] };
66 66
       planner.unapply_leveling(unleveled);
67 67
       report_xyz(unleveled);
@@ -69,9 +69,9 @@
69 69
 
70 70
     #if IS_KINEMATIC
71 71
       #if IS_SCARA
72
-        SERIAL_PROTOCOLPGM("ScaraK: ");
72
+        SERIAL_ECHOPGM("ScaraK: ");
73 73
       #else
74
-        SERIAL_PROTOCOLPGM("DeltaK: ");
74
+        SERIAL_ECHOPGM("DeltaK: ");
75 75
       #endif
76 76
       inverse_kinematics(leveled);  // writes delta[]
77 77
       report_xyz(delta);
@@ -79,12 +79,12 @@
79 79
 
80 80
     planner.synchronize();
81 81
 
82
-    SERIAL_PROTOCOLPGM("Stepper:");
82
+    SERIAL_ECHOPGM("Stepper:");
83 83
     LOOP_XYZE(i) {
84 84
       SERIAL_CHAR(' ');
85 85
       SERIAL_CHAR(axis_codes[i]);
86 86
       SERIAL_CHAR(':');
87
-      SERIAL_PROTOCOL(stepper.position((AxisEnum)i));
87
+      SERIAL_ECHO(stepper.position((AxisEnum)i));
88 88
     }
89 89
     SERIAL_EOL();
90 90
 
@@ -93,11 +93,11 @@
93 93
         planner.get_axis_position_degrees(A_AXIS),
94 94
         planner.get_axis_position_degrees(B_AXIS)
95 95
       };
96
-      SERIAL_PROTOCOLPGM("Degrees:");
96
+      SERIAL_ECHOPGM("Degrees:");
97 97
       report_xyze(deg, 2);
98 98
     #endif
99 99
 
100
-    SERIAL_PROTOCOLPGM("FromStp:");
100
+    SERIAL_ECHOPGM("FromStp:");
101 101
     get_cartesian_from_steppers();  // writes cartes[XYZ] (with forward kinematics)
102 102
     const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], planner.get_axis_position_mm(E_AXIS) };
103 103
     report_xyze(from_steppers);
@@ -108,7 +108,7 @@
108 108
       from_steppers[Z_AXIS] - leveled[Z_AXIS],
109 109
       from_steppers[E_AXIS] - current_position[E_AXIS]
110 110
     };
111
-    SERIAL_PROTOCOLPGM("Differ: ");
111
+    SERIAL_ECHOPGM("Differ: ");
112 112
     report_xyze(diff);
113 113
   }
114 114
 

+ 3
- 3
Marlin/src/gcode/host/M115.cpp Прегледај датотеку

@@ -29,10 +29,10 @@
29 29
 
30 30
 #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
31 31
   static void cap_line(PGM_P const name, bool ena=false) {
32
-    SERIAL_PROTOCOLPGM("Cap:");
32
+    SERIAL_ECHOPGM("Cap:");
33 33
     serialprintPGM(name);
34 34
     SERIAL_CHAR(':');
35
-    SERIAL_PROTOCOLLN(int(ena ? 1 : 0));
35
+    SERIAL_ECHOLN(int(ena ? 1 : 0));
36 36
   }
37 37
 #endif
38 38
 
@@ -47,7 +47,7 @@ void GcodeSuite::M115() {
47 47
     #define CAPLINE(STR,...) cap_line(PSTR(STR), __VA_ARGS__)
48 48
   #endif
49 49
 
50
-  SERIAL_PROTOCOLLNPGM_P(port, MSG_M115_REPORT);
50
+  SERIAL_ECHOLNPGM_P(port, MSG_M115_REPORT);
51 51
 
52 52
   #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
53 53
 

+ 2
- 4
Marlin/src/gcode/lcd/M145.cpp Прегледај датотеку

@@ -37,10 +37,8 @@
37 37
  */
38 38
 void GcodeSuite::M145() {
39 39
   const uint8_t material = (uint8_t)parser.intval('S');
40
-  if (material >= COUNT(ui.preheat_hotend_temp)) {
41
-    SERIAL_ERROR_START();
42
-    SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX);
43
-  }
40
+  if (material >= COUNT(ui.preheat_hotend_temp))
41
+    SERIAL_ERROR_MSG(MSG_ERR_MATERIAL_INDEX);
44 42
   else {
45 43
     int v;
46 44
     if (parser.seenval('H')) {

+ 1
- 1
Marlin/src/gcode/lcd/M250.cpp Прегледај датотеку

@@ -32,7 +32,7 @@
32 32
  */
33 33
 void GcodeSuite::M250() {
34 34
   if (parser.seen('C')) ui.set_contrast(parser.value_int());
35
-  SERIAL_PROTOCOLLNPAIR("LCD Contrast: ", ui.contrast);
35
+  SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast);
36 36
 }
37 37
 
38 38
 #endif // HAS_LCD_CONTRAST

+ 5
- 9
Marlin/src/gcode/motion/G2_G3.cpp Прегледај датотеку

@@ -293,10 +293,9 @@ void GcodeSuite::G2_G3(const bool clockwise) {
293 293
       #if ENABLED(ARC_P_CIRCLES)
294 294
         // P indicates number of circles to do
295 295
         int8_t circles_to_do = parser.byteval('P');
296
-        if (!WITHIN(circles_to_do, 0, 100)) {
297
-          SERIAL_ERROR_START();
298
-          SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS);
299
-        }
296
+        if (!WITHIN(circles_to_do, 0, 100))
297
+          SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS);
298
+
300 299
         while (circles_to_do--)
301 300
           plan_arc(current_position, arc_offset, clockwise);
302 301
       #endif
@@ -305,11 +304,8 @@ void GcodeSuite::G2_G3(const bool clockwise) {
305 304
       plan_arc(destination, arc_offset, clockwise);
306 305
       reset_stepper_timeout();
307 306
     }
308
-    else {
309
-      // Bad arguments
310
-      SERIAL_ERROR_START();
311
-      SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS);
312
-    }
307
+    else
308
+      SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS);
313 309
   }
314 310
 }
315 311
 

+ 1
- 2
Marlin/src/gcode/motion/G5.cpp Прегледај датотеку

@@ -50,8 +50,7 @@ void GcodeSuite::G5() {
50 50
 
51 51
     #if ENABLED(CNC_WORKSPACE_PLANES)
52 52
       if (workspace_plane != PLANE_XY) {
53
-        SERIAL_ERROR_START();
54
-        SERIAL_ERRORLNPGM(MSG_ERR_BAD_PLANE_MODE);
53
+        SERIAL_ERROR_MSG(MSG_ERR_BAD_PLANE_MODE);
55 54
         return;
56 55
       }
57 56
     #endif

+ 3
- 3
Marlin/src/gcode/probe/G30.cpp Прегледај датотеку

@@ -55,9 +55,9 @@ void GcodeSuite::G30() {
55 55
   const float measured_z = probe_pt(xpos, ypos, raise_after, 1);
56 56
 
57 57
   if (!isnan(measured_z)) {
58
-    SERIAL_PROTOCOLPAIR_F("Bed X: ", xpos);
59
-    SERIAL_PROTOCOLPAIR_F(" Y: ", ypos);
60
-    SERIAL_PROTOCOLLNPAIR_F(" Z: ", measured_z);
58
+    SERIAL_ECHOPAIR("Bed X: ", FIXFLOAT(xpos));
59
+    SERIAL_ECHOPAIR(" Y: ", FIXFLOAT(ypos));
60
+    SERIAL_ECHOLNPAIR(" Z: ", FIXFLOAT(measured_z));
61 61
   }
62 62
 
63 63
   clean_up_after_endstop_or_probe_move();

+ 1
- 4
Marlin/src/gcode/probe/G38.cpp Прегледај датотеку

@@ -108,10 +108,7 @@ void GcodeSuite::G38(const bool is_38_2) {
108 108
     if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) {
109 109
       if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i);
110 110
       // If G38.2 fails throw an error
111
-      if (!G38_run_probe() && is_38_2) {
112
-        SERIAL_ERROR_START();
113
-        SERIAL_ERRORLNPGM("Failed to reach target");
114
-      }
111
+      if (!G38_run_probe() && is_38_2) SERIAL_ERROR_MSG("Failed to reach target");
115 112
       break;
116 113
     }
117 114
 

+ 3
- 8
Marlin/src/gcode/probe/M851.cpp Прегледај датотеку

@@ -32,18 +32,13 @@ void GcodeSuite::M851() {
32 32
   if (parser.seenval('Z')) {
33 33
     const float value = parser.value_linear_units();
34 34
     if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
35
-    {
36 35
       zprobe_zoffset = value;
37
-    }
38
-    else {
39
-      SERIAL_ERROR_START();
40
-      SERIAL_ERRORLNPGM("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")");
41
-    }
36
+    else
37
+      SERIAL_ERROR_MSG("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")");
42 38
     return;
43 39
   }
44 40
   SERIAL_ECHO_START();
45
-  SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET);
46
-  SERIAL_ECHOLNPAIR(": ", zprobe_zoffset);
41
+  SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset);
47 42
 }
48 43
 
49 44
 #endif // HAS_BED_PROBE

+ 13
- 14
Marlin/src/gcode/queue.cpp Прегледај датотеку

@@ -221,17 +221,17 @@ void ok_to_send() {
221 221
     if (port < 0) return;
222 222
   #endif
223 223
   if (!send_ok[cmd_queue_index_r]) return;
224
-  SERIAL_PROTOCOLPGM_P(port, MSG_OK);
224
+  SERIAL_ECHOPGM_P(port, MSG_OK);
225 225
   #if ENABLED(ADVANCED_OK)
226 226
     char* p = command_queue[cmd_queue_index_r];
227 227
     if (*p == 'N') {
228
-      SERIAL_PROTOCOL_P(port, ' ');
228
+      SERIAL_ECHO_P(port, ' ');
229 229
       SERIAL_ECHO_P(port, *p++);
230 230
       while (NUMERIC_SIGNED(*p))
231 231
         SERIAL_ECHO_P(port, *p++);
232 232
     }
233
-    SERIAL_PROTOCOLPGM_P(port, " P"); SERIAL_PROTOCOL_P(port, int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1));
234
-    SERIAL_PROTOCOLPGM_P(port, " B"); SERIAL_PROTOCOL_P(port, BUFSIZE - commands_in_queue);
233
+    SERIAL_ECHOPGM_P(port, " P"); SERIAL_ECHO_P(port, int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1));
234
+    SERIAL_ECHOPGM_P(port, " B"); SERIAL_ECHO_P(port, BUFSIZE - commands_in_queue);
235 235
   #endif
236 236
   SERIAL_EOL_P(port);
237 237
 }
@@ -246,15 +246,15 @@ void flush_and_request_resend() {
246 246
     if (port < 0) return;
247 247
   #endif
248 248
   SERIAL_FLUSH_P(port);
249
-  SERIAL_PROTOCOLPGM_P(port, MSG_RESEND);
250
-  SERIAL_PROTOCOLLN_P(port, gcode_LastN + 1);
249
+  SERIAL_ECHOPGM_P(port, MSG_RESEND);
250
+  SERIAL_ECHOLN_P(port, gcode_LastN + 1);
251 251
   ok_to_send();
252 252
 }
253 253
 
254 254
 void gcode_line_error(PGM_P err, uint8_t port) {
255 255
   SERIAL_ERROR_START_P(port);
256 256
   serialprintPGM_P(port, err);
257
-  SERIAL_ERRORLN_P(port, gcode_LastN);
257
+  SERIAL_ECHOLN_P(port, gcode_LastN);
258 258
   flush_and_request_resend();
259 259
   serial_count[port] = 0;
260 260
 }
@@ -648,7 +648,7 @@ inline void get_serial_commands() {
648 648
               #if ENABLED(BEZIER_CURVE_SUPPORT)
649 649
                 case 5:
650 650
               #endif
651
-                SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
651
+                SERIAL_ECHOLNPGM(MSG_ERR_STOPPED);
652 652
                 LCD_MESSAGEPGM(MSG_STOPPED);
653 653
                 break;
654 654
             }
@@ -754,7 +754,7 @@ inline void get_serial_commands() {
754 754
           if (IS_SD_PRINTING())
755 755
             sd_count = 0; // If a sub-file was printing, continue from call point
756 756
           else {
757
-            SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
757
+            SERIAL_ECHOLNPGM(MSG_FILE_PRINTED);
758 758
             #if ENABLED(PRINTER_EVENT_LEDS)
759 759
               printerEventLEDs.onPrintCompleted();
760 760
               #if HAS_RESUME_CONTINUE
@@ -769,10 +769,9 @@ inline void get_serial_commands() {
769 769
             #endif // PRINTER_EVENT_LEDS
770 770
           }
771 771
         }
772
-        else if (n == -1) {
773
-          SERIAL_ERROR_START();
774
-          SERIAL_ECHOLNPGM(MSG_SD_ERR_READ);
775
-        }
772
+        else if (n == -1)
773
+          SERIAL_ERROR_MSG(MSG_SD_ERR_READ);
774
+
776 775
         if (sd_char == '#') stop_buffering = true;
777 776
 
778 777
         sd_comment_mode = false; // for new command
@@ -843,7 +842,7 @@ void advance_command_queue() {
843 842
       if (strstr_P(command, PSTR("M29"))) {
844 843
         // M29 closes the file
845 844
         card.closefile();
846
-        SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED);
845
+        SERIAL_ECHOLNPGM(MSG_FILE_SAVED);
847 846
 
848 847
         #if !defined(__AVR__) || !defined(USBCON)
849 848
           #if ENABLED(SERIAL_STATS_DROPPED_RX)

+ 2
- 2
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp Прегледај датотеку

@@ -50,13 +50,13 @@ void GcodeSuite::M20() {
50 50
     const int16_t port = command_queue_port[cmd_queue_index_r];
51 51
   #endif
52 52
 
53
-  SERIAL_PROTOCOLLNPGM_P(port, MSG_BEGIN_FILE_LIST);
53
+  SERIAL_ECHOLNPGM_P(port, MSG_BEGIN_FILE_LIST);
54 54
   card.ls(
55 55
     #if NUM_SERIAL > 1
56 56
       port
57 57
     #endif
58 58
   );
59
-  SERIAL_PROTOCOLLNPGM_P(port, MSG_END_FILE_LIST);
59
+  SERIAL_ECHOLNPGM_P(port, MSG_END_FILE_LIST);
60 60
 }
61 61
 
62 62
 /**

+ 2
- 3
Marlin/src/gcode/temperature/M105.cpp Прегледај датотеку

@@ -40,15 +40,14 @@ void GcodeSuite::M105() {
40 40
   #endif
41 41
 
42 42
   #if HAS_TEMP_SENSOR
43
-    SERIAL_PROTOCOLPGM_P(port, MSG_OK);
43
+    SERIAL_ECHOPGM_P(port, MSG_OK);
44 44
     thermalManager.print_heater_states(target_extruder
45 45
       #if NUM_SERIAL > 1
46 46
         , port
47 47
       #endif
48 48
     );
49 49
   #else // !HAS_TEMP_SENSOR
50
-    SERIAL_ERROR_START_P(port);
51
-    SERIAL_ERRORLNPGM_P(port, MSG_ERR_NO_THERMISTORS);
50
+    SERIAL_ERROR_MSG_P(port, MSG_ERR_NO_THERMISTORS);
52 51
   #endif
53 52
 
54 53
   SERIAL_EOL_P(port);

+ 1
- 1
Marlin/src/lcd/menu/menu_ubl.cpp Прегледај датотеку

@@ -296,7 +296,7 @@ void _menu_ubl_fillin() {
296 296
 
297 297
 void _lcd_ubl_invalidate() {
298 298
   ubl.invalidate();
299
-  SERIAL_PROTOCOLLNPGM("Mesh invalidated.");
299
+  SERIAL_ECHOLNPGM("Mesh invalidated.");
300 300
 }
301 301
 
302 302
 /**

+ 6
- 10
Marlin/src/libs/vector_3.cpp Прегледај датотеку

@@ -84,13 +84,9 @@ void vector_3::apply_rotation(const matrix_3x3 &matrix) {
84 84
 
85 85
 void vector_3::debug(PGM_P const title) {
86 86
   serialprintPGM(title);
87
-  SERIAL_PROTOCOLPGM(" x: ");
88
-  SERIAL_PROTOCOL_F(x, 6);
89
-  SERIAL_PROTOCOLPGM(" y: ");
90
-  SERIAL_PROTOCOL_F(y, 6);
91
-  SERIAL_PROTOCOLPGM(" z: ");
92
-  SERIAL_PROTOCOL_F(z, 6);
93
-  SERIAL_EOL();
87
+  SERIAL_ECHOPAIR_F(" x: ", x, 6);
88
+  SERIAL_ECHOPAIR_F(" y: ", y, 6);
89
+  SERIAL_ECHOLNPAIR_F(" z: ", z, 6);
94 90
 }
95 91
 
96 92
 void apply_rotation_xyz(const matrix_3x3 &matrix, float &x, float &y, float &z) {
@@ -151,9 +147,9 @@ void matrix_3x3::debug(PGM_P const title) {
151 147
   uint8_t count = 0;
152 148
   for (uint8_t i = 0; i < 3; i++) {
153 149
     for (uint8_t j = 0; j < 3; j++) {
154
-      if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+');
155
-      SERIAL_PROTOCOL_F(matrix[count], 6);
156
-      SERIAL_PROTOCOLCHAR(' ');
150
+      if (matrix[count] >= 0.0) SERIAL_CHAR('+');
151
+      SERIAL_ECHO_F(matrix[count], 6);
152
+      SERIAL_CHAR(' ');
157 153
       count++;
158 154
     }
159 155
     SERIAL_EOL();

+ 180
- 280
Marlin/src/module/configuration_store.cpp Прегледај датотеку

@@ -384,6 +384,36 @@ void MarlinSettings::postprocess() {
384 384
 
385 385
 #endif // SD_FIRMWARE_UPDATE
386 386
 
387
+#if ENABLED(EEPROM_CHITCHAT)
388
+  #define CHITCHAT_ECHO(V)                      SERIAL_ECHO(V)
389
+  #define CHITCHAT_ECHOLNPGM(STR)               SERIAL_ECHOLNPGM(STR)
390
+  #define CHITCHAT_ECHOPAIR(STR,V)              SERIAL_ECHOPAIR(STR,V)
391
+  #define CHITCHAT_ECHOLNPAIR(STR,V)            SERIAL_ECHOLNPAIR(STR,V)
392
+  #define CHITCHAT_ECHO_START_P(port)           SERIAL_ECHO_START_P(port)
393
+  #define CHITCHAT_ERROR_START_P(port)          SERIAL_ERROR_START_P(port)
394
+  #define CHITCHAT_ERROR_MSG_P(port, STR)       SERIAL_ERROR_MSG_P(port, STR)
395
+  #define CHITCHAT_ECHO_P(port, VAL)            SERIAL_ECHO_P(port, VAL)
396
+  #define CHITCHAT_ECHOPGM_P(port, STR)         SERIAL_ECHOPGM_P(port, STR)
397
+  #define CHITCHAT_ECHOLNPGM_P(port, STR)       SERIAL_ECHOLNPGM_P(port, STR)
398
+  #define CHITCHAT_ECHOPAIR_P(port, STR, VAL)   SERIAL_ECHOPAIR_P(port, STR, VAL)
399
+  #define CHITCHAT_ECHOLNPAIR_P(port, STR, VAL) SERIAL_ECHOLNPAIR_P(port, STR, VAL)
400
+  #define CHITCHAT_EOL()                        SERIAL_EOL()
401
+#else
402
+  #define CHITCHAT_ECHO(V)                      NOOP
403
+  #define CHITCHAT_ECHOLNPGM(STR)               NOOP
404
+  #define CHITCHAT_ECHOPAIR(STR,V)              NOOP
405
+  #define CHITCHAT_ECHOLNPAIR(STR,V)            NOOP
406
+  #define CHITCHAT_ECHO_START_P(port)           NOOP
407
+  #define CHITCHAT_ERROR_START_P(port)          NOOP
408
+  #define CHITCHAT_ERROR_MSG_P(port, STR)       NOOP
409
+  #define CHITCHAT_ECHO_P(port, VAL)            NOOP
410
+  #define CHITCHAT_ECHOPGM_P(port, STR)         NOOP
411
+  #define CHITCHAT_ECHOLNPGM_P(port, STR)       NOOP
412
+  #define CHITCHAT_ECHOPAIR_P(port, STR, VAL)   NOOP
413
+  #define CHITCHAT_ECHOLNPAIR_P(port, STR, VAL) NOOP
414
+  #define CHITCHAT_EOL()                        NOOP
415
+#endif
416
+
387 417
 #if ENABLED(EEPROM_SETTINGS)
388 418
 
389 419
   #define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start()
@@ -392,7 +422,7 @@ void MarlinSettings::postprocess() {
392 422
   #define EEPROM_WRITE(VAR) persistentStore.write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc)
393 423
   #define EEPROM_READ(VAR) persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, !validating)
394 424
   #define EEPROM_READ_ALWAYS(VAR) persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc)
395
-  #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_START_P(port); SERIAL_ERRORLNPGM_P(port, ERR); eeprom_error = true; } }while(0)
425
+  #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG_P(port, ERR); eeprom_error = true; } }while(0)
396 426
 
397 427
   #if ENABLED(DEBUG_EEPROM_READWRITE)
398 428
     #define _FIELD_TEST(FIELD) \
@@ -410,10 +440,7 @@ void MarlinSettings::postprocess() {
410 440
 
411 441
   bool MarlinSettings::size_error(const uint16_t size PORTARG_AFTER) {
412 442
     if (size != datasize()) {
413
-      #if ENABLED(EEPROM_CHITCHAT)
414
-        SERIAL_ERROR_START_P(port);
415
-        SERIAL_ERRORLNPGM_P(port, "EEPROM datasize error.");
416
-      #endif
443
+      CHITCHAT_ERROR_MSG_P(port, "EEPROM datasize error.");
417 444
       return true;
418 445
     }
419 446
     return false;
@@ -1050,12 +1077,10 @@ void MarlinSettings::postprocess() {
1050 1077
       EEPROM_WRITE(final_crc);
1051 1078
 
1052 1079
       // Report storage size
1053
-      #if ENABLED(EEPROM_CHITCHAT)
1054
-        SERIAL_ECHO_START_P(port);
1055
-        SERIAL_ECHOPAIR_P(port, "Settings Stored (", eeprom_size);
1056
-        SERIAL_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)final_crc);
1057
-        SERIAL_ECHOLNPGM_P(port, ")");
1058
-      #endif
1080
+      CHITCHAT_ECHO_START_P(port);
1081
+      CHITCHAT_ECHOPAIR_P(port, "Settings Stored (", eeprom_size);
1082
+      CHITCHAT_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)final_crc);
1083
+      CHITCHAT_ECHOLNPGM_P(port, ")");
1059 1084
 
1060 1085
       eeprom_error |= size_error(eeprom_size);
1061 1086
     }
@@ -1092,12 +1117,10 @@ void MarlinSettings::postprocess() {
1092 1117
         stored_ver[0] = '?';
1093 1118
         stored_ver[1] = '\0';
1094 1119
       }
1095
-      #if ENABLED(EEPROM_CHITCHAT)
1096
-        SERIAL_ECHO_START_P(port);
1097
-        SERIAL_ECHOPGM_P(port, "EEPROM version mismatch ");
1098
-        SERIAL_ECHOPAIR_P(port, "(EEPROM=", stored_ver);
1099
-        SERIAL_ECHOLNPGM_P(port, " Marlin=" EEPROM_VERSION ")");
1100
-      #endif
1120
+      CHITCHAT_ECHO_START_P(port);
1121
+      CHITCHAT_ECHOPGM_P(port, "EEPROM version mismatch ");
1122
+      CHITCHAT_ECHOPAIR_P(port, "(EEPROM=", stored_ver);
1123
+      CHITCHAT_ECHOLNPGM_P(port, " Marlin=" EEPROM_VERSION ")");
1101 1124
       eeprom_error = true;
1102 1125
     }
1103 1126
     else {
@@ -1704,31 +1727,25 @@ void MarlinSettings::postprocess() {
1704 1727
 
1705 1728
       eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET));
1706 1729
       if (eeprom_error) {
1707
-        #if ENABLED(EEPROM_CHITCHAT)
1708
-          SERIAL_ECHO_START_P(port);
1709
-          SERIAL_ECHOPAIR_P(port, "Index: ", int(eeprom_index - (EEPROM_OFFSET)));
1710
-          SERIAL_ECHOLNPAIR_P(port, " Size: ", datasize());
1711
-        #endif
1730
+        CHITCHAT_ECHO_START_P(port);
1731
+        CHITCHAT_ECHOPAIR_P(port, "Index: ", int(eeprom_index - (EEPROM_OFFSET)));
1732
+        CHITCHAT_ECHOLNPAIR_P(port, " Size: ", datasize());
1712 1733
       }
1713 1734
       else if (working_crc != stored_crc) {
1714 1735
         eeprom_error = true;
1715
-        #if ENABLED(EEPROM_CHITCHAT)
1716
-          SERIAL_ERROR_START_P(port);
1717
-          SERIAL_ERRORPGM_P(port, "EEPROM CRC mismatch - (stored) ");
1718
-          SERIAL_ERROR_P(port, stored_crc);
1719
-          SERIAL_ERRORPGM_P(port, " != ");
1720
-          SERIAL_ERROR_P(port, working_crc);
1721
-          SERIAL_ERRORLNPGM_P(port, " (calculated)!");
1722
-        #endif
1736
+        CHITCHAT_ERROR_START_P(port);
1737
+        CHITCHAT_ECHOPGM_P(port, "EEPROM CRC mismatch - (stored) ");
1738
+        CHITCHAT_ECHO_P(port, stored_crc);
1739
+        CHITCHAT_ECHOPGM_P(port, " != ");
1740
+        CHITCHAT_ECHO_P(port, working_crc);
1741
+        CHITCHAT_ECHOLNPGM_P(port, " (calculated)!");
1723 1742
       }
1724 1743
       else if (!validating) {
1725
-        #if ENABLED(EEPROM_CHITCHAT)
1726
-          SERIAL_ECHO_START_P(port);
1727
-          SERIAL_ECHO_P(port, version);
1728
-          SERIAL_ECHOPAIR_P(port, " stored settings retrieved (", eeprom_index - (EEPROM_OFFSET));
1729
-          SERIAL_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)working_crc);
1730
-          SERIAL_ECHOLNPGM_P(port, ")");
1731
-        #endif
1744
+        CHITCHAT_ECHO_START_P(port);
1745
+        CHITCHAT_ECHO_P(port, version);
1746
+        CHITCHAT_ECHOPAIR_P(port, " stored settings retrieved (", eeprom_index - (EEPROM_OFFSET));
1747
+        CHITCHAT_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)working_crc);
1748
+        CHITCHAT_ECHOLNPGM_P(port, ")");
1732 1749
       }
1733 1750
 
1734 1751
       if (!validating && !eeprom_error) postprocess();
@@ -1741,31 +1758,27 @@ void MarlinSettings::postprocess() {
1741 1758
             SERIAL_EOL_P(port);
1742 1759
             #if ENABLED(EEPROM_CHITCHAT)
1743 1760
               ubl.echo_name();
1744
-              SERIAL_ECHOLNPGM_P(port, " initialized.\n");
1761
+              CHITCHAT_ECHOLNPGM_P(port, " initialized.\n");
1745 1762
             #endif
1746 1763
           }
1747 1764
           else {
1748 1765
             eeprom_error = true;
1749 1766
             #if ENABLED(EEPROM_CHITCHAT)
1750
-              SERIAL_PROTOCOLPGM_P(port, "?Can't enable ");
1767
+              CHITCHAT_ECHOPGM_P(port, "?Can't enable ");
1751 1768
               ubl.echo_name();
1752
-              SERIAL_PROTOCOLLNPGM_P(port, ".");
1769
+              CHITCHAT_ECHOLNPGM_P(port, ".");
1753 1770
             #endif
1754 1771
             ubl.reset();
1755 1772
           }
1756 1773
 
1757 1774
           if (ubl.storage_slot >= 0) {
1758 1775
             load_mesh(ubl.storage_slot);
1759
-            #if ENABLED(EEPROM_CHITCHAT)
1760
-              SERIAL_ECHOPAIR_P(port, "Mesh ", ubl.storage_slot);
1761
-              SERIAL_ECHOLNPGM_P(port, " loaded from storage.");
1762
-            #endif
1776
+            CHITCHAT_ECHOPAIR_P(port, "Mesh ", ubl.storage_slot);
1777
+            CHITCHAT_ECHOLNPGM_P(port, " loaded from storage.");
1763 1778
           }
1764 1779
           else {
1765 1780
             ubl.reset();
1766
-            #if ENABLED(EEPROM_CHITCHAT)
1767
-              SERIAL_ECHOLNPGM_P(port, "UBL System reset()");
1768
-            #endif
1781
+            CHITCHAT_ECHOLNPGM_P(port, "UBL System reset()");
1769 1782
           }
1770 1783
         }
1771 1784
       #endif
@@ -1794,13 +1807,15 @@ void MarlinSettings::postprocess() {
1794 1807
 
1795 1808
   #if ENABLED(AUTO_BED_LEVELING_UBL)
1796 1809
 
1797
-    #if ENABLED(EEPROM_CHITCHAT)
1798
-      void ubl_invalid_slot(const int s) {
1799
-        SERIAL_PROTOCOLLNPGM("?Invalid slot.");
1800
-        SERIAL_PROTOCOL(s);
1801
-        SERIAL_PROTOCOLLNPGM(" mesh slots available.");
1802
-      }
1803
-    #endif
1810
+    inline void ubl_invalid_slot(const int s) {
1811
+      #if ENABLED(EEPROM_CHITCHAT)
1812
+        CHITCHAT_ECHOLNPGM("?Invalid slot.");
1813
+        CHITCHAT_ECHO(s);
1814
+        CHITCHAT_ECHOLNPGM(" mesh slots available.");
1815
+      #else
1816
+        UNUSED(s);
1817
+      #endif
1818
+    }
1804 1819
 
1805 1820
     const uint16_t MarlinSettings::meshes_end = persistentStore.capacity() - 129; // 128 (+1 because of the change to capacity rather than last valid address)
1806 1821
                                                                                   // is a placeholder for the size of the MAT; the MAT will always
@@ -1824,32 +1839,24 @@ void MarlinSettings::postprocess() {
1824 1839
       #if ENABLED(AUTO_BED_LEVELING_UBL)
1825 1840
         const int16_t a = calc_num_meshes();
1826 1841
         if (!WITHIN(slot, 0, a - 1)) {
1827
-          #if ENABLED(EEPROM_CHITCHAT)
1828
-            ubl_invalid_slot(a);
1829
-            SERIAL_PROTOCOLPAIR("E2END=", persistentStore.capacity() - 1);
1830
-            SERIAL_PROTOCOLPAIR(" meshes_end=", meshes_end);
1831
-            SERIAL_PROTOCOLLNPAIR(" slot=", slot);
1832
-            SERIAL_EOL();
1833
-          #endif
1842
+          ubl_invalid_slot(a);
1843
+          CHITCHAT_ECHOPAIR("E2END=", persistentStore.capacity() - 1);
1844
+          CHITCHAT_ECHOPAIR(" meshes_end=", meshes_end);
1845
+          CHITCHAT_ECHOLNPAIR(" slot=", slot);
1846
+          CHITCHAT_EOL();
1834 1847
           return;
1835 1848
         }
1836 1849
 
1837 1850
         int pos = mesh_slot_offset(slot);
1838 1851
         uint16_t crc = 0;
1839 1852
 
1853
+        // Write crc to MAT along with other data, or just tack on to the beginning or end
1840 1854
         persistentStore.access_start();
1841 1855
         const bool status = persistentStore.write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc);
1842 1856
         persistentStore.access_finish();
1843 1857
 
1844
-        if (status)
1845
-          SERIAL_PROTOCOLPGM("?Unable to save mesh data.\n");
1846
-
1847
-        // Write crc to MAT along with other data, or just tack on to the beginning or end
1848
-
1849
-        #if ENABLED(EEPROM_CHITCHAT)
1850
-          if (!status)
1851
-            SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot);
1852
-        #endif
1858
+        if (status) SERIAL_ECHOPGM("?Unable to save mesh data.\n");
1859
+        else        CHITCHAT_ECHOLNPAIR("Mesh saved in slot ", slot);
1853 1860
 
1854 1861
       #else
1855 1862
 
@@ -1865,9 +1872,7 @@ void MarlinSettings::postprocess() {
1865 1872
         const int16_t a = settings.calc_num_meshes();
1866 1873
 
1867 1874
         if (!WITHIN(slot, 0, a - 1)) {
1868
-          #if ENABLED(EEPROM_CHITCHAT)
1869
-            ubl_invalid_slot(a);
1870
-          #endif
1875
+          ubl_invalid_slot(a);
1871 1876
           return;
1872 1877
         }
1873 1878
 
@@ -1879,13 +1884,9 @@ void MarlinSettings::postprocess() {
1879 1884
         const uint16_t status = persistentStore.read_data(pos, dest, sizeof(ubl.z_values), &crc);
1880 1885
         persistentStore.access_finish();
1881 1886
 
1882
-        if (status)
1883
-          SERIAL_PROTOCOLPGM("?Unable to load mesh data.\n");
1887
+        if (status) SERIAL_ECHOPGM("?Unable to load mesh data.\n");
1888
+        else        CHITCHAT_ECHOLNPAIR("Mesh loaded from slot ", slot);
1884 1889
 
1885
-        #if ENABLED(EEPROM_CHITCHAT)
1886
-          else
1887
-            SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot);
1888
-        #endif
1889 1890
         EEPROM_FINISH();
1890 1891
 
1891 1892
       #else
@@ -1903,10 +1904,7 @@ void MarlinSettings::postprocess() {
1903 1904
 #else // !EEPROM_SETTINGS
1904 1905
 
1905 1906
   bool MarlinSettings::save(PORTARG_SOLO) {
1906
-    #if ENABLED(EEPROM_CHITCHAT)
1907
-      SERIAL_ERROR_START_P(port);
1908
-      SERIAL_ERRORLNPGM_P(port, "EEPROM disabled");
1909
-    #endif
1907
+    CHITCHAT_ERROR_MSG_P(port, "EEPROM disabled");
1910 1908
     return false;
1911 1909
   }
1912 1910
 
@@ -2177,15 +2175,15 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2177 2175
 
2178 2176
   postprocess();
2179 2177
 
2180
-  #if ENABLED(EEPROM_CHITCHAT)
2181
-    SERIAL_ECHO_START_P(port);
2182
-    SERIAL_ECHOLNPGM_P(port, "Hardcoded Default Settings Loaded");
2183
-  #endif
2178
+  CHITCHAT_ECHO_START_P(port);
2179
+  CHITCHAT_ECHOLNPGM_P(port, "Hardcoded Default Settings Loaded");
2184 2180
 }
2185 2181
 
2186 2182
 #if DISABLED(DISABLE_M503)
2187 2183
 
2188
-  #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0)
2184
+  #define CONFIG_ECHO_START()       do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0)
2185
+  #define CONFIG_ECHO_MSG(STR)      do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM_P(port, STR); }while(0)
2186
+  #define CONFIG_ECHO_HEADING(STR)  do{ if (!forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOLNPGM_P(port, STR); } }while(0)
2189 2187
 
2190 2188
   #if HAS_TRINAMIC
2191 2189
     void say_M906(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, "  M906"); }
@@ -2234,7 +2232,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2234 2232
     /**
2235 2233
      * Announce current units, in case inches are being displayed
2236 2234
      */
2237
-    CONFIG_ECHO_START;
2235
+    CONFIG_ECHO_START();
2238 2236
     #if ENABLED(INCH_MODE_SUPPORT)
2239 2237
       SERIAL_ECHOPGM_P(port, "  G2");
2240 2238
       SERIAL_CHAR_P(port, parser.linear_unit_factor == 1.0 ? '1' : '0');
@@ -2250,7 +2248,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2250 2248
 
2251 2249
       // Temperature units - for Ultipanel temperature options
2252 2250
 
2253
-      CONFIG_ECHO_START;
2251
+      CONFIG_ECHO_START();
2254 2252
       #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
2255 2253
         SERIAL_ECHOPGM_P(port, "  M149 ");
2256 2254
         SERIAL_CHAR_P(port, parser.temp_units_code());
@@ -2270,7 +2268,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2270 2268
        * Volumetric extrusion M200
2271 2269
        */
2272 2270
       if (!forReplay) {
2273
-        CONFIG_ECHO_START;
2271
+        CONFIG_ECHO_START();
2274 2272
         SERIAL_ECHOPGM_P(port, "Filament settings:");
2275 2273
         if (parser.volumetric_enabled)
2276 2274
           SERIAL_EOL_P(port);
@@ -2278,27 +2276,27 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2278 2276
           SERIAL_ECHOLNPGM_P(port, " Disabled");
2279 2277
       }
2280 2278
 
2281
-      CONFIG_ECHO_START;
2279
+      CONFIG_ECHO_START();
2282 2280
       SERIAL_ECHOPAIR_P(port, "  M200 D", LINEAR_UNIT(planner.filament_size[0]));
2283 2281
       SERIAL_EOL_P(port);
2284 2282
       #if EXTRUDERS > 1
2285
-        CONFIG_ECHO_START;
2283
+        CONFIG_ECHO_START();
2286 2284
         SERIAL_ECHOPAIR_P(port, "  M200 T1 D", LINEAR_UNIT(planner.filament_size[1]));
2287 2285
         SERIAL_EOL_P(port);
2288 2286
         #if EXTRUDERS > 2
2289
-          CONFIG_ECHO_START;
2287
+          CONFIG_ECHO_START();
2290 2288
           SERIAL_ECHOPAIR_P(port, "  M200 T2 D", LINEAR_UNIT(planner.filament_size[2]));
2291 2289
           SERIAL_EOL_P(port);
2292 2290
           #if EXTRUDERS > 3
2293
-            CONFIG_ECHO_START;
2291
+            CONFIG_ECHO_START();
2294 2292
             SERIAL_ECHOPAIR_P(port, "  M200 T3 D", LINEAR_UNIT(planner.filament_size[3]));
2295 2293
             SERIAL_EOL_P(port);
2296 2294
             #if EXTRUDERS > 4
2297
-              CONFIG_ECHO_START;
2295
+              CONFIG_ECHO_START();
2298 2296
               SERIAL_ECHOPAIR_P(port, "  M200 T4 D", LINEAR_UNIT(planner.filament_size[4]));
2299 2297
               SERIAL_EOL_P(port);
2300 2298
               #if EXTRUDERS > 5
2301
-                CONFIG_ECHO_START;
2299
+                CONFIG_ECHO_START();
2302 2300
                 SERIAL_ECHOPAIR_P(port, "  M200 T5 D", LINEAR_UNIT(planner.filament_size[5]));
2303 2301
                 SERIAL_EOL_P(port);
2304 2302
               #endif // EXTRUDERS > 5
@@ -2307,18 +2305,13 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2307 2305
         #endif // EXTRUDERS > 2
2308 2306
       #endif // EXTRUDERS > 1
2309 2307
 
2310
-      if (!parser.volumetric_enabled) {
2311
-        CONFIG_ECHO_START;
2312
-        SERIAL_ECHOLNPGM_P(port, "  M200 D0");
2313
-      }
2308
+      if (!parser.volumetric_enabled)
2309
+        CONFIG_ECHO_MSG("  M200 D0");
2314 2310
 
2315 2311
     #endif // !NO_VOLUMETRICS
2316 2312
 
2317
-    if (!forReplay) {
2318
-      CONFIG_ECHO_START;
2319
-      SERIAL_ECHOLNPGM_P(port, "Steps per unit:");
2320
-    }
2321
-    CONFIG_ECHO_START;
2313
+    CONFIG_ECHO_HEADING("Steps per unit:");
2314
+    CONFIG_ECHO_START();
2322 2315
     SERIAL_ECHOPAIR_P(port, "  M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]));
2323 2316
     SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]));
2324 2317
     SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
@@ -2327,18 +2320,15 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2327 2320
     #endif
2328 2321
     SERIAL_EOL_P(port);
2329 2322
     #if ENABLED(DISTINCT_E_FACTORS)
2330
-      CONFIG_ECHO_START;
2323
+      CONFIG_ECHO_START();
2331 2324
       for (uint8_t i = 0; i < E_STEPPERS; i++) {
2332 2325
         SERIAL_ECHOPAIR_P(port, "  M92 T", (int)i);
2333 2326
         SERIAL_ECHOLNPAIR_P(port, " E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS + i]));
2334 2327
       }
2335 2328
     #endif
2336 2329
 
2337
-    if (!forReplay) {
2338
-      CONFIG_ECHO_START;
2339
-      SERIAL_ECHOLNPGM_P(port, "Maximum feedrates (units/s):");
2340
-    }
2341
-    CONFIG_ECHO_START;
2330
+    CONFIG_ECHO_HEADING("Maximum feedrates (units/s):");
2331
+    CONFIG_ECHO_START();
2342 2332
     SERIAL_ECHOPAIR_P(port, "  M203 X", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]));
2343 2333
     SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS]));
2344 2334
     SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS]));
@@ -2347,18 +2337,15 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2347 2337
     #endif
2348 2338
     SERIAL_EOL_P(port);
2349 2339
     #if ENABLED(DISTINCT_E_FACTORS)
2350
-      CONFIG_ECHO_START;
2340
+      CONFIG_ECHO_START();
2351 2341
       for (uint8_t i = 0; i < E_STEPPERS; i++) {
2352 2342
         SERIAL_ECHOPAIR_P(port, "  M203 T", (int)i);
2353 2343
         SERIAL_ECHOLNPAIR_P(port, " E", VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS + i]));
2354 2344
       }
2355 2345
     #endif
2356 2346
 
2357
-    if (!forReplay) {
2358
-      CONFIG_ECHO_START;
2359
-      SERIAL_ECHOLNPGM_P(port, "Maximum Acceleration (units/s2):");
2360
-    }
2361
-    CONFIG_ECHO_START;
2347
+    CONFIG_ECHO_HEADING("Maximum Acceleration (units/s2):");
2348
+    CONFIG_ECHO_START();
2362 2349
     SERIAL_ECHOPAIR_P(port, "  M201 X", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]));
2363 2350
     SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS]));
2364 2351
     SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS]));
@@ -2367,24 +2354,21 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2367 2354
     #endif
2368 2355
     SERIAL_EOL_P(port);
2369 2356
     #if ENABLED(DISTINCT_E_FACTORS)
2370
-      CONFIG_ECHO_START;
2357
+      CONFIG_ECHO_START();
2371 2358
       for (uint8_t i = 0; i < E_STEPPERS; i++) {
2372 2359
         SERIAL_ECHOPAIR_P(port, "  M201 T", (int)i);
2373 2360
         SERIAL_ECHOLNPAIR_P(port, " E", VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS + i]));
2374 2361
       }
2375 2362
     #endif
2376 2363
 
2377
-    if (!forReplay) {
2378
-      CONFIG_ECHO_START;
2379
-      SERIAL_ECHOLNPGM_P(port, "Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>");
2380
-    }
2381
-    CONFIG_ECHO_START;
2364
+    CONFIG_ECHO_HEADING("Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>");
2365
+    CONFIG_ECHO_START();
2382 2366
     SERIAL_ECHOPAIR_P(port, "  M204 P", LINEAR_UNIT(planner.settings.acceleration));
2383 2367
     SERIAL_ECHOPAIR_P(port, " R", LINEAR_UNIT(planner.settings.retract_acceleration));
2384 2368
     SERIAL_ECHOLNPAIR_P(port, " T", LINEAR_UNIT(planner.settings.travel_acceleration));
2385 2369
 
2386 2370
     if (!forReplay) {
2387
-      CONFIG_ECHO_START;
2371
+      CONFIG_ECHO_START();
2388 2372
       SERIAL_ECHOPGM_P(port, "Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>");
2389 2373
       #if ENABLED(JUNCTION_DEVIATION)
2390 2374
         SERIAL_ECHOPGM_P(port, " J<junc_dev>");
@@ -2397,7 +2381,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2397 2381
       #endif
2398 2382
       SERIAL_EOL_P(port);
2399 2383
     }
2400
-    CONFIG_ECHO_START;
2384
+    CONFIG_ECHO_START();
2401 2385
     SERIAL_ECHOPAIR_P(port, "  M205 B", LINEAR_UNIT(planner.settings.min_segment_time_us));
2402 2386
     SERIAL_ECHOPAIR_P(port, " S", LINEAR_UNIT(planner.settings.min_feedrate_mm_s));
2403 2387
     SERIAL_ECHOPAIR_P(port, " T", LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s));
@@ -2417,29 +2401,21 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2417 2401
     SERIAL_EOL_P(port);
2418 2402
 
2419 2403
     #if HAS_M206_COMMAND
2420
-      if (!forReplay) {
2421
-        CONFIG_ECHO_START;
2422
-        SERIAL_ECHOLNPGM_P(port, "Home offset:");
2423
-      }
2424
-      CONFIG_ECHO_START;
2404
+      CONFIG_ECHO_HEADING("Home offset:");
2405
+      CONFIG_ECHO_START();
2425 2406
       SERIAL_ECHOPAIR_P(port, "  M206 X", LINEAR_UNIT(home_offset[X_AXIS]));
2426 2407
       SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(home_offset[Y_AXIS]));
2427 2408
       SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(home_offset[Z_AXIS]));
2428 2409
     #endif
2429 2410
 
2430 2411
     #if HAS_HOTEND_OFFSET
2431
-      if (!forReplay) {
2432
-        CONFIG_ECHO_START;
2433
-        SERIAL_ECHOLNPGM_P(port, "Hotend offsets:");
2434
-      }
2435
-      CONFIG_ECHO_START;
2412
+      CONFIG_ECHO_HEADING("Hotend offsets:");
2413
+      CONFIG_ECHO_START();
2436 2414
       for (uint8_t e = 1; e < HOTENDS; e++) {
2437 2415
         SERIAL_ECHOPAIR_P(port, "  M218 T", (int)e);
2438 2416
         SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]));
2439 2417
         SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]));
2440
-        SERIAL_ECHO_P(port, " Z");
2441
-        SERIAL_ECHO_F_P(port, LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3);
2442
-        SERIAL_EOL_P(port);
2418
+        SERIAL_ECHOLNPAIR_F_P(port, " Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3);
2443 2419
       }
2444 2420
     #endif
2445 2421
 
@@ -2450,29 +2426,23 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2450 2426
 
2451 2427
       #if ENABLED(MESH_BED_LEVELING)
2452 2428
 
2453
-        if (!forReplay) {
2454
-          CONFIG_ECHO_START;
2455
-          SERIAL_ECHOLNPGM_P(port, "Mesh Bed Leveling:");
2456
-        }
2429
+        CONFIG_ECHO_HEADING("Mesh Bed Leveling:");
2457 2430
 
2458 2431
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
2459 2432
 
2460 2433
         if (!forReplay) {
2461
-          CONFIG_ECHO_START;
2434
+          CONFIG_ECHO_START();
2462 2435
           ubl.echo_name();
2463 2436
           SERIAL_ECHOLNPGM_P(port, ":");
2464 2437
         }
2465 2438
 
2466 2439
       #elif HAS_ABL
2467 2440
 
2468
-        if (!forReplay) {
2469
-          CONFIG_ECHO_START;
2470
-          SERIAL_ECHOLNPGM_P(port, "Auto Bed Leveling:");
2471
-        }
2441
+        CONFIG_ECHO_HEADING("Auto Bed Leveling:");
2472 2442
 
2473 2443
       #endif
2474 2444
 
2475
-      CONFIG_ECHO_START;
2445
+      CONFIG_ECHO_START();
2476 2446
       SERIAL_ECHOPAIR_P(port, "  M420 S", planner.leveling_active ? 1 : 0);
2477 2447
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
2478 2448
         SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.z_fade_height));
@@ -2484,12 +2454,10 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2484 2454
         if (leveling_is_valid()) {
2485 2455
           for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) {
2486 2456
             for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) {
2487
-              CONFIG_ECHO_START;
2457
+              CONFIG_ECHO_START();
2488 2458
               SERIAL_ECHOPAIR_P(port, "  G29 S3 X", (int)px + 1);
2489 2459
               SERIAL_ECHOPAIR_P(port, " Y", (int)py + 1);
2490
-              SERIAL_ECHOPGM_P(port, " Z");
2491
-              SERIAL_ECHO_F_P(port, LINEAR_UNIT(mbl.z_values[px][py]), 5);
2492
-              SERIAL_EOL_P(port);
2460
+              SERIAL_ECHOLNPAIR_F_P(port, " Z", LINEAR_UNIT(mbl.z_values[px][py]), 5);
2493 2461
             }
2494 2462
           }
2495 2463
         }
@@ -2504,19 +2472,17 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2504 2472
           SERIAL_ECHOLNPGM_P(port, " meshes.\n");
2505 2473
         }
2506 2474
 
2507
-//      ubl.report_current_mesh(PORTVAR_SOLO);   // This is too verbose for large mesh's.   A better (more terse)
2508
-                                                 // solution needs to be found.
2475
+       //ubl.report_current_mesh(PORTVAR_SOLO);   // This is too verbose for large meshes. A better (more terse)
2476
+                                                  // solution needs to be found.
2509 2477
       #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
2510 2478
 
2511 2479
         if (leveling_is_valid()) {
2512 2480
           for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) {
2513 2481
             for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) {
2514
-              CONFIG_ECHO_START;
2482
+              CONFIG_ECHO_START();
2515 2483
               SERIAL_ECHOPAIR_P(port, "  G29 W I", (int)px);
2516 2484
               SERIAL_ECHOPAIR_P(port, " J", (int)py);
2517
-              SERIAL_ECHOPGM_P(port, " Z");
2518
-              SERIAL_ECHO_F_P(port, LINEAR_UNIT(z_values[px][py]), 5);
2519
-              SERIAL_EOL_P(port);
2485
+              SERIAL_ECHOLNPAIR_F_P(port, " Z", LINEAR_UNIT(z_values[px][py]), 5);
2520 2486
             }
2521 2487
           }
2522 2488
         }
@@ -2527,10 +2493,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2527 2493
 
2528 2494
     #if HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES)
2529 2495
 
2530
-      if (!forReplay) {
2531
-        CONFIG_ECHO_START;
2532
-        SERIAL_ECHOLNPGM_P(port, "Servo Angles:");
2533
-      }
2496
+      CONFIG_ECHO_HEADING("Servo Angles:");
2534 2497
       for (uint8_t i = 0; i < NUM_SERVOS; i++) {
2535 2498
         switch (i) {
2536 2499
           #if ENABLED(SWITCHING_EXTRUDER)
@@ -2543,7 +2506,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2543 2506
           #elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR)
2544 2507
             case Z_PROBE_SERVO_NR:
2545 2508
           #endif
2546
-            CONFIG_ECHO_START;
2509
+            CONFIG_ECHO_START();
2547 2510
             SERIAL_ECHOPAIR_P(port, "  M281 P", int(i));
2548 2511
             SERIAL_ECHOPAIR_P(port, " L", servo_angles[i][0]);
2549 2512
             SERIAL_ECHOPAIR_P(port, " U", servo_angles[i][1]);
@@ -2556,11 +2519,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2556 2519
 
2557 2520
     #if HAS_SCARA_OFFSET
2558 2521
 
2559
-      if (!forReplay) {
2560
-        CONFIG_ECHO_START;
2561
-        SERIAL_ECHOLNPGM_P(port, "SCARA settings: S<seg-per-sec> P<theta-psi-offset> T<theta-offset>");
2562
-      }
2563
-      CONFIG_ECHO_START;
2522
+      CONFIG_ECHO_HEADING("SCARA settings: S<seg-per-sec> P<theta-psi-offset> T<theta-offset>");
2523
+      CONFIG_ECHO_START();
2564 2524
       SERIAL_ECHOPAIR_P(port, "  M665 S", delta_segments_per_second);
2565 2525
       SERIAL_ECHOPAIR_P(port, " P", scara_home_offset[A_AXIS]);
2566 2526
       SERIAL_ECHOPAIR_P(port, " T", scara_home_offset[B_AXIS]);
@@ -2569,19 +2529,14 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2569 2529
 
2570 2530
     #elif ENABLED(DELTA)
2571 2531
 
2572
-      if (!forReplay) {
2573
-        CONFIG_ECHO_START;
2574
-        SERIAL_ECHOLNPGM_P(port, "Endstop adjustment:");
2575
-      }
2576
-      CONFIG_ECHO_START;
2532
+      CONFIG_ECHO_HEADING("Endstop adjustment:");
2533
+      CONFIG_ECHO_START();
2577 2534
       SERIAL_ECHOPAIR_P(port, "  M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS]));
2578 2535
       SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS]));
2579 2536
       SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS]));
2580
-      if (!forReplay) {
2581
-        CONFIG_ECHO_START;
2582
-        SERIAL_ECHOLNPGM_P(port, "Delta settings: L<diagonal_rod> R<radius> H<height> S<segments_per_s> B<calibration radius> XYZ<tower angle corrections>");
2583
-      }
2584
-      CONFIG_ECHO_START;
2537
+
2538
+      CONFIG_ECHO_HEADING("Delta settings: L<diagonal_rod> R<radius> H<height> S<segments_per_s> B<calibration radius> XYZ<tower angle corrections>");
2539
+      CONFIG_ECHO_START();
2585 2540
       SERIAL_ECHOPAIR_P(port, "  M665 L", LINEAR_UNIT(delta_diagonal_rod));
2586 2541
       SERIAL_ECHOPAIR_P(port, " R", LINEAR_UNIT(delta_radius));
2587 2542
       SERIAL_ECHOPAIR_P(port, " H", LINEAR_UNIT(delta_height));
@@ -2594,11 +2549,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2594 2549
 
2595 2550
     #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
2596 2551
 
2597
-      if (!forReplay) {
2598
-        CONFIG_ECHO_START;
2599
-        SERIAL_ECHOLNPGM_P(port, "Endstop adjustment:");
2600
-      }
2601
-      CONFIG_ECHO_START;
2552
+      CONFIG_ECHO_HEADING("Endstop adjustment:");
2553
+      CONFIG_ECHO_START();
2602 2554
       SERIAL_ECHOPGM_P(port, "  M666");
2603 2555
       #if ENABLED(X_DUAL_ENDSTOPS)
2604 2556
         SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(endstops.x2_endstop_adj));
@@ -2608,7 +2560,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2608 2560
       #endif
2609 2561
       #if ENABLED(Z_TRIPLE_ENDSTOPS)
2610 2562
         SERIAL_ECHOLNPAIR_P(port, "S1 Z", LINEAR_UNIT(endstops.z2_endstop_adj));
2611
-        CONFIG_ECHO_START;
2563
+        CONFIG_ECHO_START();
2612 2564
         SERIAL_ECHOPAIR_P(port, "  M666 S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj));
2613 2565
       #elif ENABLED(Z_DUAL_ENDSTOPS)
2614 2566
         SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(endstops.z2_endstop_adj));
@@ -2619,12 +2571,9 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2619 2571
 
2620 2572
     #if HAS_LCD_MENU
2621 2573
 
2622
-      if (!forReplay) {
2623
-        CONFIG_ECHO_START;
2624
-        SERIAL_ECHOLNPGM_P(port, "Material heatup parameters:");
2625
-      }
2574
+      CONFIG_ECHO_HEADING("Material heatup parameters:");
2626 2575
       for (uint8_t i = 0; i < COUNT(ui.preheat_hotend_temp); i++) {
2627
-        CONFIG_ECHO_START;
2576
+        CONFIG_ECHO_START();
2628 2577
         SERIAL_ECHOPAIR_P(port, "  M145 S", (int)i);
2629 2578
         SERIAL_ECHOPAIR_P(port, " H", TEMP_UNIT(ui.preheat_hotend_temp[i]));
2630 2579
         SERIAL_ECHOPAIR_P(port, " B", TEMP_UNIT(ui.preheat_bed_temp[i]));
@@ -2635,15 +2584,12 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2635 2584
 
2636 2585
     #if HAS_PID_HEATING
2637 2586
 
2638
-      if (!forReplay) {
2639
-        CONFIG_ECHO_START;
2640
-        SERIAL_ECHOLNPGM_P(port, "PID settings:");
2641
-      }
2587
+      CONFIG_ECHO_HEADING("PID settings:");
2642 2588
       #if ENABLED(PIDTEMP)
2643 2589
         #if HOTENDS > 1
2644 2590
           if (forReplay) {
2645 2591
             HOTEND_LOOP() {
2646
-              CONFIG_ECHO_START;
2592
+              CONFIG_ECHO_START();
2647 2593
               SERIAL_ECHOPAIR_P(port, "  M301 E", e);
2648 2594
               SERIAL_ECHOPAIR_P(port, " P", PID_PARAM(Kp, e));
2649 2595
               SERIAL_ECHOPAIR_P(port, " I", unscalePID_i(PID_PARAM(Ki, e)));
@@ -2659,7 +2605,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2659 2605
         #endif // HOTENDS > 1
2660 2606
         // !forReplay || HOTENDS == 1
2661 2607
         {
2662
-          CONFIG_ECHO_START;
2608
+          CONFIG_ECHO_START();
2663 2609
           SERIAL_ECHOPAIR_P(port, "  M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0
2664 2610
           SERIAL_ECHOPAIR_P(port, " I", unscalePID_i(PID_PARAM(Ki, 0)));
2665 2611
           SERIAL_ECHOPAIR_P(port, " D", unscalePID_d(PID_PARAM(Kd, 0)));
@@ -2672,7 +2618,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2672 2618
       #endif // PIDTEMP
2673 2619
 
2674 2620
       #if ENABLED(PIDTEMPBED)
2675
-        CONFIG_ECHO_START;
2621
+        CONFIG_ECHO_START();
2676 2622
         SERIAL_ECHOPAIR_P(port, "  M304 P", thermalManager.bed_pid.Kp);
2677 2623
         SERIAL_ECHOPAIR_P(port, " I", unscalePID_i(thermalManager.bed_pid.Ki));
2678 2624
         SERIAL_ECHOPAIR_P(port, " D", unscalePID_d(thermalManager.bed_pid.Kd));
@@ -2682,51 +2628,36 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2682 2628
     #endif // PIDTEMP || PIDTEMPBED
2683 2629
 
2684 2630
     #if HAS_LCD_CONTRAST
2685
-      if (!forReplay) {
2686
-        CONFIG_ECHO_START;
2687
-        SERIAL_ECHOLNPGM_P(port, "LCD Contrast:");
2688
-      }
2689
-      CONFIG_ECHO_START;
2631
+      CONFIG_ECHO_HEADING("LCD Contrast:");
2632
+      CONFIG_ECHO_START();
2690 2633
       SERIAL_ECHOLNPAIR_P(port, "  M250 C", ui.contrast);
2691 2634
     #endif
2692 2635
 
2693 2636
     #if ENABLED(POWER_LOSS_RECOVERY)
2694
-      if (!forReplay) {
2695
-        CONFIG_ECHO_START;
2696
-        SERIAL_ECHOLNPGM_P(port, "Power-Loss Recovery:");
2697
-      }
2698
-      CONFIG_ECHO_START;
2637
+      CONFIG_ECHO_HEADING("Power-Loss Recovery:");
2638
+      CONFIG_ECHO_START();
2699 2639
       SERIAL_ECHOLNPAIR_P(port, "  M413 S", int(recovery.enabled));
2700 2640
     #endif
2701 2641
 
2702 2642
     #if ENABLED(FWRETRACT)
2703 2643
 
2704
-      if (!forReplay) {
2705
-        CONFIG_ECHO_START;
2706
-        SERIAL_ECHOLNPGM_P(port, "Retract: S<length> F<units/m> Z<lift>");
2707
-      }
2708
-      CONFIG_ECHO_START;
2644
+      CONFIG_ECHO_HEADING("Retract: S<length> F<units/m> Z<lift>");
2645
+      CONFIG_ECHO_START();
2709 2646
       SERIAL_ECHOPAIR_P(port, "  M207 S", LINEAR_UNIT(fwretract.settings.retract_length));
2710 2647
       SERIAL_ECHOPAIR_P(port, " W", LINEAR_UNIT(fwretract.settings.swap_retract_length));
2711 2648
       SERIAL_ECHOPAIR_P(port, " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_feedrate_mm_s)));
2712 2649
       SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(fwretract.settings.retract_zraise));
2713 2650
 
2714
-      if (!forReplay) {
2715
-        CONFIG_ECHO_START;
2716
-        SERIAL_ECHOLNPGM_P(port, "Recover: S<length> F<units/m>");
2717
-      }
2718
-      CONFIG_ECHO_START;
2651
+      CONFIG_ECHO_HEADING("Recover: S<length> F<units/m>");
2652
+      CONFIG_ECHO_START();
2719 2653
       SERIAL_ECHOPAIR_P(port, "  M208 S", LINEAR_UNIT(fwretract.settings.retract_recover_length));
2720 2654
       SERIAL_ECHOPAIR_P(port, " W", LINEAR_UNIT(fwretract.settings.swap_retract_recover_length));
2721 2655
       SERIAL_ECHOLNPAIR_P(port, " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_recover_feedrate_mm_s)));
2722 2656
 
2723 2657
       #if ENABLED(FWRETRACT_AUTORETRACT)
2724 2658
 
2725
-        if (!forReplay) {
2726
-          CONFIG_ECHO_START;
2727
-          SERIAL_ECHOLNPGM_P(port, "Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover");
2728
-        }
2729
-        CONFIG_ECHO_START;
2659
+        CONFIG_ECHO_HEADING("Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover");
2660
+        CONFIG_ECHO_START();
2730 2661
         SERIAL_ECHOLNPAIR_P(port, "  M209 S", fwretract.autoretract_enabled ? 1 : 0);
2731 2662
 
2732 2663
       #endif // FWRETRACT_AUTORETRACT
@@ -2738,11 +2669,11 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2738 2669
      */
2739 2670
     #if HAS_BED_PROBE
2740 2671
       if (!forReplay) {
2741
-        CONFIG_ECHO_START;
2672
+        CONFIG_ECHO_START();
2742 2673
         SERIAL_ECHOPGM_P(port, "Z-Probe Offset");
2743 2674
         SAY_UNITS_P(port, true);
2744 2675
       }
2745
-      CONFIG_ECHO_START;
2676
+      CONFIG_ECHO_START();
2746 2677
       SERIAL_ECHOLNPAIR_P(port, "  M851 Z", LINEAR_UNIT(zprobe_zoffset));
2747 2678
     #endif
2748 2679
 
@@ -2750,23 +2681,14 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2750 2681
      * Bed Skew Correction
2751 2682
      */
2752 2683
     #if ENABLED(SKEW_CORRECTION_GCODE)
2753
-      if (!forReplay) {
2754
-        CONFIG_ECHO_START;
2755
-        SERIAL_ECHOLNPGM_P(port, "Skew Factor: ");
2756
-      }
2757
-      CONFIG_ECHO_START;
2684
+      CONFIG_ECHO_HEADING("Skew Factor: ");
2685
+      CONFIG_ECHO_START();
2758 2686
       #if ENABLED(SKEW_CORRECTION_FOR_Z)
2759
-        SERIAL_ECHOPGM_P(port, "  M852 I");
2760
-        SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.xy), 6);
2761
-        SERIAL_ECHOPGM_P(port, " J");
2762
-        SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.xz), 6);
2763
-        SERIAL_ECHOPGM_P(port, " K");
2764
-        SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.yz), 6);
2765
-        SERIAL_EOL_P(port);
2687
+        SERIAL_ECHOPAIR_F_P(port, "  M852 I", LINEAR_UNIT(planner.skew_factor.xy), 6);
2688
+        SERIAL_ECHOPAIR_F_P(port, " J", LINEAR_UNIT(planner.skew_factor.xz), 6);
2689
+        SERIAL_ECHOLNPAIR_F_P(port, " K", LINEAR_UNIT(planner.skew_factor.yz), 6);
2766 2690
       #else
2767
-        SERIAL_ECHOPGM_P(port, "  M852 S");
2768
-        SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.xy), 6);
2769
-        SERIAL_EOL_P(port);
2691
+        SERIAL_ECHOLNPAIR_F_P(port, "  M852 S", LINEAR_UNIT(planner.skew_factor.xy), 6);
2770 2692
       #endif
2771 2693
     #endif
2772 2694
 
@@ -2775,11 +2697,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2775 2697
       /**
2776 2698
        * TMC stepper driver current
2777 2699
        */
2778
-      if (!forReplay) {
2779
-        CONFIG_ECHO_START;
2780
-        SERIAL_ECHOLNPGM_P(port, "Stepper driver current:");
2781
-      }
2782
-      CONFIG_ECHO_START;
2700
+      CONFIG_ECHO_HEADING("Stepper driver current:");
2701
+      CONFIG_ECHO_START();
2783 2702
       #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
2784 2703
         say_M906(PORTVAR_SOLO);
2785 2704
       #endif
@@ -2848,11 +2767,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2848 2767
        * TMC Hybrid Threshold
2849 2768
        */
2850 2769
       #if ENABLED(HYBRID_THRESHOLD)
2851
-        if (!forReplay) {
2852
-          CONFIG_ECHO_START;
2853
-          SERIAL_ECHOLNPGM_P(port, "Hybrid Threshold:");
2854
-        }
2855
-        CONFIG_ECHO_START;
2770
+        CONFIG_ECHO_HEADING("Hybrid Threshold:");
2771
+        CONFIG_ECHO_START();
2856 2772
         #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z)
2857 2773
           say_M913(PORTVAR_SOLO);
2858 2774
         #endif
@@ -2923,11 +2839,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2923 2839
        * TMC Sensorless homing thresholds
2924 2840
        */
2925 2841
       #if USE_SENSORLESS
2926
-        if (!forReplay) {
2927
-          CONFIG_ECHO_START;
2928
-          SERIAL_ECHOLNPGM_P(port, "TMC2130 StallGuard threshold:");
2929
-        }
2930
-        CONFIG_ECHO_START;
2842
+        CONFIG_ECHO_HEADING("TMC2130 StallGuard threshold:");
2843
+        CONFIG_ECHO_START();
2931 2844
         #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
2932 2845
           say_M914(PORTVAR_SOLO);
2933 2846
           #if X_SENSORLESS
@@ -2975,12 +2888,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2975 2888
      * Linear Advance
2976 2889
      */
2977 2890
     #if ENABLED(LIN_ADVANCE)
2978
-      if (!forReplay) {
2979
-        CONFIG_ECHO_START;
2980
-        SERIAL_ECHOLNPGM_P(port, "Linear Advance:");
2981
-      }
2982
-
2983
-      CONFIG_ECHO_START;
2891
+      CONFIG_ECHO_HEADING("Linear Advance:");
2892
+      CONFIG_ECHO_START();
2984 2893
       #if EXTRUDERS < 2
2985 2894
         SERIAL_ECHOLNPAIR_P(port, "  M900 K", planner.extruder_advance_K[0]);
2986 2895
       #else
@@ -2992,11 +2901,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
2992 2901
     #endif
2993 2902
 
2994 2903
     #if HAS_MOTOR_CURRENT_PWM
2995
-      CONFIG_ECHO_START;
2996
-      if (!forReplay) {
2997
-        SERIAL_ECHOLNPGM_P(port, "Stepper motor currents:");
2998
-        CONFIG_ECHO_START;
2999
-      }
2904
+      CONFIG_ECHO_HEADING("Stepper motor currents:");
2905
+      CONFIG_ECHO_START();
3000 2906
       SERIAL_ECHOPAIR_P(port, "  M907 X", stepper.motor_current_setting[0]);
3001 2907
       SERIAL_ECHOPAIR_P(port, " Z", stepper.motor_current_setting[1]);
3002 2908
       SERIAL_ECHOPAIR_P(port, " E", stepper.motor_current_setting[2]);
@@ -3007,11 +2913,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
3007 2913
      * Advanced Pause filament load & unload lengths
3008 2914
      */
3009 2915
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
3010
-      if (!forReplay) {
3011
-        CONFIG_ECHO_START;
3012
-        SERIAL_ECHOLNPGM_P(port, "Filament load/unload lengths:");
3013
-      }
3014
-      CONFIG_ECHO_START;
2916
+      CONFIG_ECHO_HEADING("Filament load/unload lengths:");
2917
+      CONFIG_ECHO_START();
3015 2918
       #if EXTRUDERS == 1
3016 2919
         say_M603(PORTVAR_SOLO);
3017 2920
         SERIAL_ECHOPAIR_P(port, "L", LINEAR_UNIT(fc_settings[0].load_length));
@@ -3020,27 +2923,27 @@ void MarlinSettings::reset(PORTARG_SOLO) {
3020 2923
         say_M603(PORTVAR_SOLO);
3021 2924
         SERIAL_ECHOPAIR_P(port, "T0 L", LINEAR_UNIT(fc_settings[0].load_length));
3022 2925
         SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[0].unload_length));
3023
-        CONFIG_ECHO_START;
2926
+        CONFIG_ECHO_START();
3024 2927
         say_M603(PORTVAR_SOLO);
3025 2928
         SERIAL_ECHOPAIR_P(port, "T1 L", LINEAR_UNIT(fc_settings[1].load_length));
3026 2929
         SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[1].unload_length));
3027 2930
         #if EXTRUDERS > 2
3028
-          CONFIG_ECHO_START;
2931
+          CONFIG_ECHO_START();
3029 2932
           say_M603(PORTVAR_SOLO);
3030 2933
           SERIAL_ECHOPAIR_P(port, "T2 L", LINEAR_UNIT(fc_settings[2].load_length));
3031 2934
           SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[2].unload_length));
3032 2935
           #if EXTRUDERS > 3
3033
-            CONFIG_ECHO_START;
2936
+            CONFIG_ECHO_START();
3034 2937
             say_M603(PORTVAR_SOLO);
3035 2938
             SERIAL_ECHOPAIR_P(port, "T3 L", LINEAR_UNIT(fc_settings[3].load_length));
3036 2939
             SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[3].unload_length));
3037 2940
             #if EXTRUDERS > 4
3038
-              CONFIG_ECHO_START;
2941
+              CONFIG_ECHO_START();
3039 2942
               say_M603(PORTVAR_SOLO);
3040 2943
               SERIAL_ECHOPAIR_P(port, "T4 L", LINEAR_UNIT(fc_settings[4].load_length));
3041 2944
               SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[4].unload_length));
3042 2945
               #if EXTRUDERS > 5
3043
-                CONFIG_ECHO_START;
2946
+                CONFIG_ECHO_START();
3044 2947
                 say_M603(PORTVAR_SOLO);
3045 2948
                 SERIAL_ECHOPAIR_P(port, "T5 L", LINEAR_UNIT(fc_settings[5].load_length));
3046 2949
                 SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[5].unload_length));
@@ -3052,11 +2955,8 @@ void MarlinSettings::reset(PORTARG_SOLO) {
3052 2955
     #endif // ADVANCED_PAUSE_FEATURE
3053 2956
 
3054 2957
     #if EXTRUDERS > 1
3055
-      CONFIG_ECHO_START;
3056
-      if (!forReplay) {
3057
-        SERIAL_ECHOLNPGM_P(port, "Tool-changing:");
3058
-        CONFIG_ECHO_START;
3059
-      }
2958
+      CONFIG_ECHO_HEADING("Tool-changing:");
2959
+      CONFIG_ECHO_START();
3060 2960
       M217_report(true);
3061 2961
     #endif
3062 2962
   }

+ 19
- 19
Marlin/src/module/endstops.cpp Прегледај датотеку

@@ -365,13 +365,13 @@ void Endstops::event_handler() {
365 365
 
366 366
 static void print_es_state(const bool is_hit, PGM_P const label=NULL) {
367 367
   if (label) serialprintPGM(label);
368
-  SERIAL_PROTOCOLPGM(": ");
368
+  SERIAL_ECHOPGM(": ");
369 369
   serialprintPGM(is_hit ? PSTR(MSG_ENDSTOP_HIT) : PSTR(MSG_ENDSTOP_OPEN));
370 370
   SERIAL_EOL();
371 371
 }
372 372
 
373 373
 void _O2 Endstops::M119() {
374
-  SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT);
374
+  SERIAL_ECHOLNPGM(MSG_M119_REPORT);
375 375
   #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(MSG_##S))
376 376
   #if HAS_X_MIN
377 377
     ES_REPORT(X_MIN);
@@ -441,7 +441,7 @@ void _O2 Endstops::M119() {
441 441
             #endif
442 442
           #endif
443 443
         }
444
-        SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR);
444
+        SERIAL_ECHOPGM(MSG_FILAMENT_RUNOUT_SENSOR);
445 445
         if (i > 1) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + i); }
446 446
         print_es_state(digitalRead(pin) != FIL_RUNOUT_INVERTING);
447 447
       }
@@ -825,51 +825,51 @@ void Endstops::update() {
825 825
 
826 826
     if (endstop_change) {
827 827
       #if HAS_X_MIN
828
-        if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR("  X_MIN:", TEST(live_state_local, X_MIN));
828
+        if (TEST(endstop_change, X_MIN)) SERIAL_ECHOPAIR("  X_MIN:", TEST(live_state_local, X_MIN));
829 829
       #endif
830 830
       #if HAS_X_MAX
831
-        if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR("  X_MAX:", TEST(live_state_local, X_MAX));
831
+        if (TEST(endstop_change, X_MAX)) SERIAL_ECHOPAIR("  X_MAX:", TEST(live_state_local, X_MAX));
832 832
       #endif
833 833
       #if HAS_Y_MIN
834
-        if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR("  Y_MIN:", TEST(live_state_local, Y_MIN));
834
+        if (TEST(endstop_change, Y_MIN)) SERIAL_ECHOPAIR("  Y_MIN:", TEST(live_state_local, Y_MIN));
835 835
       #endif
836 836
       #if HAS_Y_MAX
837
-        if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR("  Y_MAX:", TEST(live_state_local, Y_MAX));
837
+        if (TEST(endstop_change, Y_MAX)) SERIAL_ECHOPAIR("  Y_MAX:", TEST(live_state_local, Y_MAX));
838 838
       #endif
839 839
       #if HAS_Z_MIN
840
-        if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR("  Z_MIN:", TEST(live_state_local, Z_MIN));
840
+        if (TEST(endstop_change, Z_MIN)) SERIAL_ECHOPAIR("  Z_MIN:", TEST(live_state_local, Z_MIN));
841 841
       #endif
842 842
       #if HAS_Z_MAX
843
-        if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR("  Z_MAX:", TEST(live_state_local, Z_MAX));
843
+        if (TEST(endstop_change, Z_MAX)) SERIAL_ECHOPAIR("  Z_MAX:", TEST(live_state_local, Z_MAX));
844 844
       #endif
845 845
       #if HAS_Z_MIN_PROBE_PIN
846
-        if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR("  PROBE:", TEST(live_state_local, Z_MIN_PROBE));
846
+        if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_ECHOPAIR("  PROBE:", TEST(live_state_local, Z_MIN_PROBE));
847 847
       #endif
848 848
       #if HAS_X2_MIN
849
-        if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR("  X2_MIN:", TEST(live_state_local, X2_MIN));
849
+        if (TEST(endstop_change, X2_MIN)) SERIAL_ECHOPAIR("  X2_MIN:", TEST(live_state_local, X2_MIN));
850 850
       #endif
851 851
       #if HAS_X2_MAX
852
-        if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR("  X2_MAX:", TEST(live_state_local, X2_MAX));
852
+        if (TEST(endstop_change, X2_MAX)) SERIAL_ECHOPAIR("  X2_MAX:", TEST(live_state_local, X2_MAX));
853 853
       #endif
854 854
       #if HAS_Y2_MIN
855
-        if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR("  Y2_MIN:", TEST(live_state_local, Y2_MIN));
855
+        if (TEST(endstop_change, Y2_MIN)) SERIAL_ECHOPAIR("  Y2_MIN:", TEST(live_state_local, Y2_MIN));
856 856
       #endif
857 857
       #if HAS_Y2_MAX
858
-        if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR("  Y2_MAX:", TEST(live_state_local, Y2_MAX));
858
+        if (TEST(endstop_change, Y2_MAX)) SERIAL_ECHOPAIR("  Y2_MAX:", TEST(live_state_local, Y2_MAX));
859 859
       #endif
860 860
       #if HAS_Z2_MIN
861
-        if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR("  Z2_MIN:", TEST(live_state_local, Z2_MIN));
861
+        if (TEST(endstop_change, Z2_MIN)) SERIAL_ECHOPAIR("  Z2_MIN:", TEST(live_state_local, Z2_MIN));
862 862
       #endif
863 863
       #if HAS_Z2_MAX
864
-        if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR("  Z2_MAX:", TEST(live_state_local, Z2_MAX));
864
+        if (TEST(endstop_change, Z2_MAX)) SERIAL_ECHOPAIR("  Z2_MAX:", TEST(live_state_local, Z2_MAX));
865 865
       #endif
866 866
       #if HAS_Z3_MIN
867
-        if (TEST(endstop_change, Z3_MIN)) SERIAL_PROTOCOLPAIR("  Z3_MIN:", TEST(live_state_local, Z3_MIN));
867
+        if (TEST(endstop_change, Z3_MIN)) SERIAL_ECHOPAIR("  Z3_MIN:", TEST(live_state_local, Z3_MIN));
868 868
       #endif
869 869
       #if HAS_Z3_MAX
870
-        if (TEST(endstop_change, Z3_MAX)) SERIAL_PROTOCOLPAIR("  Z3_MAX:", TEST(live_state_local, Z3_MAX));
870
+        if (TEST(endstop_change, Z3_MAX)) SERIAL_ECHOPAIR("  Z3_MAX:", TEST(live_state_local, Z3_MAX));
871 871
       #endif
872
-      SERIAL_PROTOCOLPGM("\n\n");
872
+      SERIAL_ECHOPGM("\n\n");
873 873
       analogWrite(LED_PIN, local_LED_status);
874 874
       local_LED_status ^= 255;
875 875
       old_live_state_local = live_state_local;

+ 7
- 14
Marlin/src/module/motion.cpp Прегледај датотеку

@@ -163,14 +163,10 @@ float cartes[XYZ];
163 163
  * Output the current position to serial
164 164
  */
165 165
 void report_current_position() {
166
-  SERIAL_PROTOCOLPGM("X:");
167
-  SERIAL_PROTOCOL(LOGICAL_X_POSITION(current_position[X_AXIS]));
168
-  SERIAL_PROTOCOLPGM(" Y:");
169
-  SERIAL_PROTOCOL(LOGICAL_Y_POSITION(current_position[Y_AXIS]));
170
-  SERIAL_PROTOCOLPGM(" Z:");
171
-  SERIAL_PROTOCOL(LOGICAL_Z_POSITION(current_position[Z_AXIS]));
172
-  SERIAL_PROTOCOLPGM(" E:");
173
-  SERIAL_PROTOCOL(current_position[E_AXIS]);
166
+  SERIAL_ECHOPAIR("X:", LOGICAL_X_POSITION(current_position[X_AXIS]));
167
+  SERIAL_ECHOPAIR(" Y:", LOGICAL_Y_POSITION(current_position[Y_AXIS]));
168
+  SERIAL_ECHOPAIR(" Z:", LOGICAL_Z_POSITION(current_position[Z_AXIS]));
169
+  SERIAL_ECHOPAIR(" E:", current_position[E_AXIS]);
174 170
 
175 171
   stepper.report_positions();
176 172
 
@@ -967,15 +963,13 @@ void prepare_move_to_destination() {
967 963
         #if ENABLED(PREVENT_COLD_EXTRUSION)
968 964
           if (thermalManager.tooColdToExtrude(active_extruder)) {
969 965
             current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
970
-            SERIAL_ECHO_START();
971
-            SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
966
+            SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP);
972 967
           }
973 968
         #endif // PREVENT_COLD_EXTRUSION
974 969
         #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
975 970
           if (ABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) {
976 971
             current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part
977
-            SERIAL_ECHO_START();
978
-            SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
972
+            SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP);
979 973
           }
980 974
         #endif // PREVENT_LENGTHY_EXTRUDE
981 975
       }
@@ -1046,8 +1040,7 @@ inline float get_homing_bump_feedrate(const AxisEnum axis) {
1046 1040
   uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]);
1047 1041
   if (hbd < 1) {
1048 1042
     hbd = 10;
1049
-    SERIAL_ECHO_START();
1050
-    SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1");
1043
+    SERIAL_ECHO_MSG("Warning: Homing Bump Divisor < 1");
1051 1044
   }
1052 1045
   return homing_feedrate(axis) / hbd;
1053 1046
 }

+ 2
- 4
Marlin/src/module/planner.cpp Прегледај датотеку

@@ -1661,8 +1661,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1661 1661
             position_float[E_AXIS] = target_float[E_AXIS];
1662 1662
           #endif
1663 1663
           de = 0; // no difference
1664
-          SERIAL_ECHO_START();
1665
-          SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
1664
+          SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP);
1666 1665
         }
1667 1666
       #endif // PREVENT_COLD_EXTRUSION
1668 1667
       #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
@@ -1672,8 +1671,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1672 1671
             position_float[E_AXIS] = target_float[E_AXIS];
1673 1672
           #endif
1674 1673
           de = 0; // no difference
1675
-          SERIAL_ECHO_START();
1676
-          SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
1674
+          SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP);
1677 1675
         }
1678 1676
       #endif // PREVENT_LENGTHY_EXTRUDE
1679 1677
     }

+ 3
- 3
Marlin/src/module/printcounter.cpp Прегледај датотеку

@@ -111,7 +111,7 @@ void PrintCounter::saveStats() {
111 111
 void PrintCounter::showStats() {
112 112
   char buffer[21];
113 113
 
114
-  SERIAL_PROTOCOLPGM(MSG_STATS);
114
+  SERIAL_ECHOPGM(MSG_STATS);
115 115
 
116 116
   SERIAL_ECHOPGM("Prints: ");
117 117
   SERIAL_ECHO(data.totalPrints);
@@ -124,7 +124,7 @@ void PrintCounter::showStats() {
124 124
     - ((isRunning() || isPaused()) ? 1 : 0));
125 125
 
126 126
   SERIAL_EOL();
127
-  SERIAL_PROTOCOLPGM(MSG_STATS);
127
+  SERIAL_ECHOPGM(MSG_STATS);
128 128
 
129 129
   duration_t elapsed = data.printTime;
130 130
   elapsed.toString(buffer);
@@ -151,7 +151,7 @@ void PrintCounter::showStats() {
151 151
   #endif
152 152
 
153 153
   SERIAL_EOL();
154
-  SERIAL_PROTOCOLPGM(MSG_STATS);
154
+  SERIAL_ECHOPGM(MSG_STATS);
155 155
 
156 156
   SERIAL_ECHOPGM("Filament used: ");
157 157
   SERIAL_ECHO(data.filamentUsed / 1000);

+ 7
- 15
Marlin/src/module/probe.cpp Прегледај датотеку

@@ -320,8 +320,7 @@ float zprobe_zoffset; // Initialized by settings.load()
320 320
                                          //  (Measured completion time was 0.65 seconds
321 321
                                          //   after reset, deploy, and stow sequence)
322 322
       if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
323
-        SERIAL_ERROR_START();
324
-        SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH);
323
+        SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH);
325 324
         stop();                          // punt!
326 325
         return true;
327 326
       }
@@ -450,8 +449,7 @@ bool set_probe_deployed(const bool deploy) {
450 449
       #define _AUE_ARGS
451 450
     #endif
452 451
     if (axis_unhomed_error(_AUE_ARGS)) {
453
-      SERIAL_ERROR_START();
454
-      SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED);
452
+      SERIAL_ERROR_MSG(MSG_STOP_UNHOMED);
455 453
       stop();
456 454
       return true;
457 455
     }
@@ -479,8 +477,7 @@ bool set_probe_deployed(const bool deploy) {
479 477
 
480 478
     if (PROBE_STOWED() == deploy) {                // Unchanged after deploy/stow action?
481 479
       if (IsRunning()) {
482
-        SERIAL_ERROR_START();
483
-        SERIAL_ERRORLNPGM("Z-Probe failed");
480
+        SERIAL_ERROR_MSG("Z-Probe failed");
484 481
         LCD_ALERTMESSAGEPGM("Err: ZPROBE");
485 482
       }
486 483
       stop();
@@ -771,13 +768,9 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
771 768
   }
772 769
 
773 770
   if (verbose_level > 2) {
774
-    SERIAL_PROTOCOLPGM("Bed X: ");
775
-    SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 3);
776
-    SERIAL_PROTOCOLPGM(" Y: ");
777
-    SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 3);
778
-    SERIAL_PROTOCOLPGM(" Z: ");
779
-    SERIAL_PROTOCOL_F(measured_z, 3);
780
-    SERIAL_EOL();
771
+    SERIAL_ECHOPAIR_F("Bed X: ", LOGICAL_X_POSITION(rx), 3);
772
+    SERIAL_ECHOPAIR_F(" Y: ", LOGICAL_Y_POSITION(ry), 3);
773
+    SERIAL_ECHOLNPAIR_F(" Z: ", measured_z, 3);
781 774
   }
782 775
 
783 776
   feedrate_mm_s = old_feedrate_mm_s;
@@ -785,8 +778,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/
785 778
   if (isnan(measured_z)) {
786 779
     STOW_PROBE();
787 780
     LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);
788
-    SERIAL_ERROR_START();
789
-    SERIAL_ERRORLNPGM(MSG_ERR_PROBING_FAILED);
781
+    SERIAL_ERROR_MSG(MSG_ERR_PROBING_FAILED);
790 782
   }
791 783
 
792 784
   #if ENABLED(DEBUG_LEVELING_FEATURE)

+ 2
- 2
Marlin/src/module/scara.cpp Прегледај датотеку

@@ -142,8 +142,8 @@ void inverse_kinematics(const float (&raw)[XYZ]) {
142 142
 }
143 143
 
144 144
 void scara_report_positions() {
145
-  SERIAL_PROTOCOLPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS));
146
-  SERIAL_PROTOCOLLNPAIR("   Psi+Theta:", planner.get_axis_position_degrees(B_AXIS));
145
+  SERIAL_ECHOPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS));
146
+  SERIAL_ECHOLNPAIR("   Psi+Theta:", planner.get_axis_position_degrees(B_AXIS));
147 147
   SERIAL_EOL();
148 148
 }
149 149
 

+ 46
- 47
Marlin/src/module/stepper.cpp Прегледај датотеку

@@ -2218,25 +2218,25 @@ void Stepper::report_positions() {
2218 2218
   if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT();
2219 2219
 
2220 2220
   #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA
2221
-    SERIAL_PROTOCOLPGM(MSG_COUNT_A);
2221
+    SERIAL_ECHOPGM(MSG_COUNT_A);
2222 2222
   #else
2223
-    SERIAL_PROTOCOLPGM(MSG_COUNT_X);
2223
+    SERIAL_ECHOPGM(MSG_COUNT_X);
2224 2224
   #endif
2225
-  SERIAL_PROTOCOL(xpos);
2225
+  SERIAL_ECHO(xpos);
2226 2226
 
2227 2227
   #if CORE_IS_XY || CORE_IS_YZ || ENABLED(DELTA) || IS_SCARA
2228
-    SERIAL_PROTOCOLPGM(" B:");
2228
+    SERIAL_ECHOPGM(" B:");
2229 2229
   #else
2230
-    SERIAL_PROTOCOLPGM(" Y:");
2230
+    SERIAL_ECHOPGM(" Y:");
2231 2231
   #endif
2232
-  SERIAL_PROTOCOL(ypos);
2232
+  SERIAL_ECHO(ypos);
2233 2233
 
2234 2234
   #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA)
2235
-    SERIAL_PROTOCOLPGM(" C:");
2235
+    SERIAL_ECHOPGM(" C:");
2236 2236
   #else
2237
-    SERIAL_PROTOCOLPGM(" Z:");
2237
+    SERIAL_ECHOPGM(" Z:");
2238 2238
   #endif
2239
-  SERIAL_PROTOCOL(zpos);
2239
+  SERIAL_ECHO(zpos);
2240 2240
 
2241 2241
   SERIAL_EOL();
2242 2242
 }
@@ -2813,82 +2813,81 @@ void Stepper::report_positions() {
2813 2813
         case 128: microstep_ms(driver, MICROSTEP128); break;
2814 2814
       #endif
2815 2815
 
2816
-      default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break;
2816
+      default: SERIAL_ERROR_MSG("Microsteps unavailable"); break;
2817 2817
     }
2818 2818
   }
2819 2819
 
2820 2820
   void Stepper::microstep_readings() {
2821
-    SERIAL_PROTOCOLLNPGM("MS1,MS2,MS3 Pins");
2822
-    SERIAL_PROTOCOLPGM("X: ");
2821
+    SERIAL_ECHOPGM("MS1,MS2,MS3 Pins\nX: ");
2823 2822
     #if HAS_X_MICROSTEPS
2824
-      SERIAL_PROTOCOL(READ(X_MS1_PIN));
2825
-      SERIAL_PROTOCOL(READ(X_MS2_PIN));
2823
+      SERIAL_ECHO(READ(X_MS1_PIN));
2824
+      SERIAL_ECHO(READ(X_MS2_PIN));
2826 2825
       #if PIN_EXISTS(X_MS3)
2827
-        SERIAL_PROTOCOLLN(READ(X_MS3_PIN));
2826
+        SERIAL_ECHOLN(READ(X_MS3_PIN));
2828 2827
       #endif
2829 2828
     #endif
2830 2829
     #if HAS_Y_MICROSTEPS
2831
-      SERIAL_PROTOCOLPGM("Y: ");
2832
-      SERIAL_PROTOCOL(READ(Y_MS1_PIN));
2833
-      SERIAL_PROTOCOL(READ(Y_MS2_PIN));
2830
+      SERIAL_ECHOPGM("Y: ");
2831
+      SERIAL_ECHO(READ(Y_MS1_PIN));
2832
+      SERIAL_ECHO(READ(Y_MS2_PIN));
2834 2833
       #if PIN_EXISTS(Y_MS3)
2835
-        SERIAL_PROTOCOLLN(READ(Y_MS3_PIN));
2834
+        SERIAL_ECHOLN(READ(Y_MS3_PIN));
2836 2835
       #endif
2837 2836
     #endif
2838 2837
     #if HAS_Z_MICROSTEPS
2839
-      SERIAL_PROTOCOLPGM("Z: ");
2840
-      SERIAL_PROTOCOL(READ(Z_MS1_PIN));
2841
-      SERIAL_PROTOCOL(READ(Z_MS2_PIN));
2838
+      SERIAL_ECHOPGM("Z: ");
2839
+      SERIAL_ECHO(READ(Z_MS1_PIN));
2840
+      SERIAL_ECHO(READ(Z_MS2_PIN));
2842 2841
       #if PIN_EXISTS(Z_MS3)
2843
-        SERIAL_PROTOCOLLN(READ(Z_MS3_PIN));
2842
+        SERIAL_ECHOLN(READ(Z_MS3_PIN));
2844 2843
       #endif
2845 2844
     #endif
2846 2845
     #if HAS_E0_MICROSTEPS
2847
-      SERIAL_PROTOCOLPGM("E0: ");
2848
-      SERIAL_PROTOCOL(READ(E0_MS1_PIN));
2849
-      SERIAL_PROTOCOL(READ(E0_MS2_PIN));
2846
+      SERIAL_ECHOPGM("E0: ");
2847
+      SERIAL_ECHO(READ(E0_MS1_PIN));
2848
+      SERIAL_ECHO(READ(E0_MS2_PIN));
2850 2849
       #if PIN_EXISTS(E0_MS3)
2851
-        SERIAL_PROTOCOLLN(READ(E0_MS3_PIN));
2850
+        SERIAL_ECHOLN(READ(E0_MS3_PIN));
2852 2851
       #endif
2853 2852
     #endif
2854 2853
     #if HAS_E1_MICROSTEPS
2855
-      SERIAL_PROTOCOLPGM("E1: ");
2856
-      SERIAL_PROTOCOL(READ(E1_MS1_PIN));
2857
-      SERIAL_PROTOCOL(READ(E1_MS2_PIN));
2854
+      SERIAL_ECHOPGM("E1: ");
2855
+      SERIAL_ECHO(READ(E1_MS1_PIN));
2856
+      SERIAL_ECHO(READ(E1_MS2_PIN));
2858 2857
       #if PIN_EXISTS(E1_MS3)
2859
-        SERIAL_PROTOCOLLN(READ(E1_MS3_PIN));
2858
+        SERIAL_ECHOLN(READ(E1_MS3_PIN));
2860 2859
       #endif
2861 2860
     #endif
2862 2861
     #if HAS_E2_MICROSTEPS
2863
-      SERIAL_PROTOCOLPGM("E2: ");
2864
-      SERIAL_PROTOCOL(READ(E2_MS1_PIN));
2865
-      SERIAL_PROTOCOL(READ(E2_MS2_PIN));
2862
+      SERIAL_ECHOPGM("E2: ");
2863
+      SERIAL_ECHO(READ(E2_MS1_PIN));
2864
+      SERIAL_ECHO(READ(E2_MS2_PIN));
2866 2865
       #if PIN_EXISTS(E2_MS3)
2867
-        SERIAL_PROTOCOLLN(READ(E2_MS3_PIN));
2866
+        SERIAL_ECHOLN(READ(E2_MS3_PIN));
2868 2867
       #endif
2869 2868
     #endif
2870 2869
     #if HAS_E3_MICROSTEPS
2871
-      SERIAL_PROTOCOLPGM("E3: ");
2872
-      SERIAL_PROTOCOL(READ(E3_MS1_PIN));
2873
-      SERIAL_PROTOCOL(READ(E3_MS2_PIN));
2870
+      SERIAL_ECHOPGM("E3: ");
2871
+      SERIAL_ECHO(READ(E3_MS1_PIN));
2872
+      SERIAL_ECHO(READ(E3_MS2_PIN));
2874 2873
       #if PIN_EXISTS(E3_MS3)
2875
-        SERIAL_PROTOCOLLN(READ(E3_MS3_PIN));
2874
+        SERIAL_ECHOLN(READ(E3_MS3_PIN));
2876 2875
       #endif
2877 2876
     #endif
2878 2877
     #if HAS_E4_MICROSTEPS
2879
-      SERIAL_PROTOCOLPGM("E4: ");
2880
-      SERIAL_PROTOCOL(READ(E4_MS1_PIN));
2881
-      SERIAL_PROTOCOL(READ(E4_MS2_PIN));
2878
+      SERIAL_ECHOPGM("E4: ");
2879
+      SERIAL_ECHO(READ(E4_MS1_PIN));
2880
+      SERIAL_ECHO(READ(E4_MS2_PIN));
2882 2881
       #if PIN_EXISTS(E4_MS3)
2883
-        SERIAL_PROTOCOLLN(READ(E4_MS3_PIN));
2882
+        SERIAL_ECHOLN(READ(E4_MS3_PIN));
2884 2883
       #endif
2885 2884
     #endif
2886 2885
     #if HAS_E5_MICROSTEPS
2887
-      SERIAL_PROTOCOLPGM("E5: ");
2888
-      SERIAL_PROTOCOL(READ(E5_MS1_PIN));
2889
-      SERIAL_PROTOCOLLN(READ(E5_MS2_PIN));
2886
+      SERIAL_ECHOPGM("E5: ");
2887
+      SERIAL_ECHO(READ(E5_MS1_PIN));
2888
+      SERIAL_ECHOLN(READ(E5_MS2_PIN));
2890 2889
       #if PIN_EXISTS(E5_MS3)
2891
-        SERIAL_PROTOCOLLN(READ(E5_MS3_PIN));
2890
+        SERIAL_ECHOLN(READ(E5_MS3_PIN));
2892 2891
       #endif
2893 2892
     #endif
2894 2893
   }

+ 62
- 62
Marlin/src/module/temperature.cpp Прегледај датотеку

@@ -228,7 +228,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
228 228
 
229 229
 #if HAS_PID_HEATING
230 230
 
231
-  inline void say_default_() { SERIAL_PROTOCOLPGM("#define DEFAULT_"); }
231
+  inline void say_default_() { SERIAL_ECHOPGM("#define DEFAULT_"); }
232 232
 
233 233
   /**
234 234
    * PID Autotuning (M303)
@@ -343,37 +343,37 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
343 343
               bias = constrain(bias, 20, max_pow - 20);
344 344
               d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias;
345 345
 
346
-              SERIAL_PROTOCOLPAIR(MSG_BIAS, bias);
347
-              SERIAL_PROTOCOLPAIR(MSG_D, d);
348
-              SERIAL_PROTOCOLPAIR(MSG_T_MIN, min);
349
-              SERIAL_PROTOCOLPAIR(MSG_T_MAX, max);
346
+              SERIAL_ECHOPAIR(MSG_BIAS, bias);
347
+              SERIAL_ECHOPAIR(MSG_D, d);
348
+              SERIAL_ECHOPAIR(MSG_T_MIN, min);
349
+              SERIAL_ECHOPAIR(MSG_T_MAX, max);
350 350
               if (cycles > 2) {
351 351
                 float Ku = (4.0f * d) / (float(M_PI) * (max - min) * 0.5f),
352 352
                       Tu = ((float)(t_low + t_high) * 0.001f);
353
-                SERIAL_PROTOCOLPAIR(MSG_KU, Ku);
354
-                SERIAL_PROTOCOLPAIR(MSG_TU, Tu);
353
+                SERIAL_ECHOPAIR(MSG_KU, Ku);
354
+                SERIAL_ECHOPAIR(MSG_TU, Tu);
355 355
                 tune_pid.Kp = 0.6f * Ku;
356 356
                 tune_pid.Ki = 2 * tune_pid.Kp / Tu;
357 357
                 tune_pid.Kd = tune_pid.Kp * Tu * 0.125f;
358
-                SERIAL_PROTOCOLLNPGM("\n" MSG_CLASSIC_PID);
359
-                SERIAL_PROTOCOLPAIR(MSG_KP, tune_pid.Kp);
360
-                SERIAL_PROTOCOLPAIR(MSG_KI, tune_pid.Ki);
361
-                SERIAL_PROTOCOLLNPAIR(MSG_KD, tune_pid.Kd);
358
+                SERIAL_ECHOLNPGM("\n" MSG_CLASSIC_PID);
359
+                SERIAL_ECHOPAIR(MSG_KP, tune_pid.Kp);
360
+                SERIAL_ECHOPAIR(MSG_KI, tune_pid.Ki);
361
+                SERIAL_ECHOLNPAIR(MSG_KD, tune_pid.Kd);
362 362
                 /**
363 363
                 tune_pid.Kp = 0.33*Ku;
364 364
                 tune_pid.Ki = tune_pid.Kp/Tu;
365 365
                 tune_pid.Kd = tune_pid.Kp*Tu/3;
366
-                SERIAL_PROTOCOLLNPGM(" Some overshoot");
367
-                SERIAL_PROTOCOLPAIR(" Kp: ", tune_pid.Kp);
368
-                SERIAL_PROTOCOLPAIR(" Ki: ", tune_pid.Ki);
369
-                SERIAL_PROTOCOLPAIR(" Kd: ", tune_pid.Kd);
366
+                SERIAL_ECHOLNPGM(" Some overshoot");
367
+                SERIAL_ECHOPAIR(" Kp: ", tune_pid.Kp);
368
+                SERIAL_ECHOPAIR(" Ki: ", tune_pid.Ki);
369
+                SERIAL_ECHOPAIR(" Kd: ", tune_pid.Kd);
370 370
                 tune_pid.Kp = 0.2*Ku;
371 371
                 tune_pid.Ki = 2*tune_pid.Kp/Tu;
372 372
                 tune_pid.Kd = tune_pid.Kp*Tu/3;
373
-                SERIAL_PROTOCOLLNPGM(" No overshoot");
374
-                SERIAL_PROTOCOLPAIR(" Kp: ", tune_pid.Kp);
375
-                SERIAL_PROTOCOLPAIR(" Ki: ", tune_pid.Ki);
376
-                SERIAL_PROTOCOLPAIR(" Kd: ", tune_pid.Kd);
373
+                SERIAL_ECHOLNPGM(" No overshoot");
374
+                SERIAL_ECHOPAIR(" Kp: ", tune_pid.Kp);
375
+                SERIAL_ECHOPAIR(" Ki: ", tune_pid.Ki);
376
+                SERIAL_ECHOPAIR(" Kd: ", tune_pid.Kd);
377 377
                 */
378 378
               }
379 379
             }
@@ -389,7 +389,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
389 389
         #define MAX_OVERSHOOT_PID_AUTOTUNE 20
390 390
       #endif
391 391
       if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) {
392
-        SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH);
392
+        SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH);
393 393
         break;
394 394
       }
395 395
 
@@ -432,26 +432,26 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS];
432 432
         #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L
433 433
       #endif
434 434
       if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) {
435
-        SERIAL_PROTOCOLLNPGM(MSG_PID_TIMEOUT);
435
+        SERIAL_ECHOLNPGM(MSG_PID_TIMEOUT);
436 436
         break;
437 437
       }
438 438
 
439 439
       if (cycles > ncycles) {
440
-        SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED);
440
+        SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED);
441 441
 
442 442
         #if HAS_PID_FOR_BOTH
443 443
           const char * const estring = GHV(PSTR("bed"), PSTR(""));
444
-          say_default_(); serialprintPGM(estring); SERIAL_PROTOCOLLNPAIR("Kp ", tune_pid.Kp);
445
-          say_default_(); serialprintPGM(estring); SERIAL_PROTOCOLLNPAIR("Ki ", tune_pid.Ki);
446
-          say_default_(); serialprintPGM(estring); SERIAL_PROTOCOLLNPAIR("Kd ", tune_pid.Kd);
444
+          say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp);
445
+          say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki);
446
+          say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd);
447 447
         #elif ENABLED(PIDTEMP)
448
-          say_default_(); SERIAL_PROTOCOLLNPAIR("Kp ", tune_pid.Kp);
449
-          say_default_(); SERIAL_PROTOCOLLNPAIR("Ki ", tune_pid.Ki);
450
-          say_default_(); SERIAL_PROTOCOLLNPAIR("Kd ", tune_pid.Kd);
448
+          say_default_(); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp);
449
+          say_default_(); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki);
450
+          say_default_(); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd);
451 451
         #else
452
-          say_default_(); SERIAL_PROTOCOLLNPAIR("bedKp ", tune_pid.Kp);
453
-          say_default_(); SERIAL_PROTOCOLLNPAIR("bedKi ", tune_pid.Ki);
454
-          say_default_(); SERIAL_PROTOCOLLNPAIR("bedKd ", tune_pid.Kd);
452
+          say_default_(); SERIAL_ECHOLNPAIR("bedKp ", tune_pid.Kp);
453
+          say_default_(); SERIAL_ECHOLNPAIR("bedKi ", tune_pid.Ki);
454
+          say_default_(); SERIAL_ECHOLNPAIR("bedKd ", tune_pid.Kd);
455 455
         #endif
456 456
 
457 457
         #define _SET_BED_PID() do { \
@@ -564,8 +564,8 @@ void Temperature::_temp_error(const int8_t heater, PGM_P const serial_msg, PGM_P
564 564
   if (IsRunning()) {
565 565
     SERIAL_ERROR_START();
566 566
     serialprintPGM(serial_msg);
567
-    SERIAL_ERRORPGM(MSG_STOPPED_HEATER);
568
-    if (heater >= 0) SERIAL_ERRORLN((int)heater); else SERIAL_ERRORLNPGM(MSG_HEATER_BED);
567
+    SERIAL_ECHOPGM(MSG_STOPPED_HEATER);
568
+    if (heater >= 0) SERIAL_ECHOLN((int)heater); else SERIAL_ECHOLNPGM(MSG_HEATER_BED);
569 569
   }
570 570
   #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE)
571 571
     if (!killed) {
@@ -940,8 +940,8 @@ float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) {
940 940
   #endif
941 941
     {
942 942
       SERIAL_ERROR_START();
943
-      SERIAL_ERROR((int)e);
944
-      SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM);
943
+      SERIAL_ECHO((int)e);
944
+      SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM);
945 945
       kill();
946 946
       return 0.0;
947 947
     }
@@ -1684,17 +1684,17 @@ void Temperature::disable_all_heaters() {
1684 1684
 
1685 1685
     if (max6675_temp & MAX6675_ERROR_MASK) {
1686 1686
       SERIAL_ERROR_START();
1687
-      SERIAL_ERRORPGM("Temp measurement error! ");
1687
+      SERIAL_ECHOPGM("Temp measurement error! ");
1688 1688
       #if MAX6675_ERROR_MASK == 7
1689
-        SERIAL_ERRORPGM("MAX31855 ");
1689
+        SERIAL_ECHOPGM("MAX31855 ");
1690 1690
         if (max6675_temp & 1)
1691
-          SERIAL_ERRORLNPGM("Open Circuit");
1691
+          SERIAL_ECHOLNPGM("Open Circuit");
1692 1692
         else if (max6675_temp & 2)
1693
-          SERIAL_ERRORLNPGM("Short to GND");
1693
+          SERIAL_ECHOLNPGM("Short to GND");
1694 1694
         else if (max6675_temp & 4)
1695
-          SERIAL_ERRORLNPGM("Short to VCC");
1695
+          SERIAL_ECHOLNPGM("Short to VCC");
1696 1696
       #else
1697
-        SERIAL_ERRORLNPGM("MAX6675");
1697
+        SERIAL_ECHOLNPGM("MAX6675");
1698 1698
       #endif
1699 1699
 
1700 1700
       // Thermocouple open
@@ -2365,8 +2365,8 @@ void Temperature::isr() {
2365 2365
       UNUSED(e);
2366 2366
     #endif
2367 2367
 
2368
-    SERIAL_PROTOCOLCHAR_P(port, ' ');
2369
-    SERIAL_PROTOCOLCHAR_P(port,
2368
+    SERIAL_CHAR_P(port, ' ');
2369
+    SERIAL_CHAR_P(port,
2370 2370
       #if HAS_TEMP_CHAMBER && HAS_HEATED_BED && HAS_TEMP_HOTEND
2371 2371
         e == -2 ? 'C' : e == -1 ? 'B' : 'T'
2372 2372
       #elif HAS_HEATED_BED && HAS_TEMP_HOTEND
@@ -2378,14 +2378,14 @@ void Temperature::isr() {
2378 2378
       #endif
2379 2379
     );
2380 2380
     #if HOTENDS > 1
2381
-      if (e >= 0) SERIAL_PROTOCOLCHAR_P(port, '0' + e);
2381
+      if (e >= 0) SERIAL_CHAR_P(port, '0' + e);
2382 2382
     #endif
2383
-    SERIAL_PROTOCOLCHAR_P(port, ':');
2384
-    SERIAL_PROTOCOL_P(port, c);
2385
-    SERIAL_PROTOCOLPAIR_P(port, " /" , t);
2383
+    SERIAL_CHAR_P(port, ':');
2384
+    SERIAL_ECHO_P(port, c);
2385
+    SERIAL_ECHOPAIR_P(port, " /" , t);
2386 2386
     #if ENABLED(SHOW_TEMP_ADC_VALUES)
2387
-      SERIAL_PROTOCOLPAIR_P(port, " (", r / OVERSAMPLENR);
2388
-      SERIAL_PROTOCOLCHAR_P(port, ')');
2387
+      SERIAL_ECHOPAIR_P(port, " (", r / OVERSAMPLENR);
2388
+      SERIAL_CHAR_P(port, ')');
2389 2389
     #endif
2390 2390
     delay(2);
2391 2391
   }
@@ -2435,17 +2435,17 @@ void Temperature::isr() {
2435 2435
         , e
2436 2436
       );
2437 2437
     #endif
2438
-    SERIAL_PROTOCOLPGM_P(port, " @:");
2439
-    SERIAL_PROTOCOL_P(port, getHeaterPower(target_extruder));
2438
+    SERIAL_ECHOPGM_P(port, " @:");
2439
+    SERIAL_ECHO_P(port, getHeaterPower(target_extruder));
2440 2440
     #if HAS_HEATED_BED
2441
-      SERIAL_PROTOCOLPGM_P(port, " B@:");
2442
-      SERIAL_PROTOCOL_P(port, getHeaterPower(-1));
2441
+      SERIAL_ECHOPGM_P(port, " B@:");
2442
+      SERIAL_ECHO_P(port, getHeaterPower(-1));
2443 2443
     #endif
2444 2444
     #if HOTENDS > 1
2445 2445
       HOTEND_LOOP() {
2446
-        SERIAL_PROTOCOLPAIR_P(port, " @", e);
2447
-        SERIAL_PROTOCOLCHAR_P(port, ':');
2448
-        SERIAL_PROTOCOL_P(port, getHeaterPower(e));
2446
+        SERIAL_ECHOPAIR_P(port, " @", e);
2447
+        SERIAL_CHAR_P(port, ':');
2448
+        SERIAL_ECHO_P(port, getHeaterPower(e));
2449 2449
       }
2450 2450
     #endif
2451 2451
   }
@@ -2528,11 +2528,11 @@ void Temperature::isr() {
2528 2528
           next_temp_ms = now + 1000UL;
2529 2529
           print_heater_states(target_extruder);
2530 2530
           #if TEMP_RESIDENCY_TIME > 0
2531
-            SERIAL_PROTOCOLPGM(" W:");
2531
+            SERIAL_ECHOPGM(" W:");
2532 2532
             if (residency_start_ms)
2533
-              SERIAL_PROTOCOL(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
2533
+              SERIAL_ECHO(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
2534 2534
             else
2535
-              SERIAL_PROTOCOLCHAR('?');
2535
+              SERIAL_CHAR('?');
2536 2536
           #endif
2537 2537
           SERIAL_EOL();
2538 2538
         }
@@ -2651,11 +2651,11 @@ void Temperature::isr() {
2651 2651
           next_temp_ms = now + 1000UL;
2652 2652
           print_heater_states(active_extruder);
2653 2653
           #if TEMP_BED_RESIDENCY_TIME > 0
2654
-            SERIAL_PROTOCOLPGM(" W:");
2654
+            SERIAL_ECHOPGM(" W:");
2655 2655
             if (residency_start_ms)
2656
-              SERIAL_PROTOCOL(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
2656
+              SERIAL_ECHO(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
2657 2657
             else
2658
-              SERIAL_PROTOCOLCHAR('?');
2658
+              SERIAL_CHAR('?');
2659 2659
           #endif
2660 2660
           SERIAL_EOL();
2661 2661
         }

+ 1
- 2
Marlin/src/module/tool_change.cpp Прегледај датотеку

@@ -553,8 +553,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
553 553
       #endif
554 554
       if (should_swap) {
555 555
         if (too_cold) {
556
-          SERIAL_ERROR_START();
557
-          SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD);
556
+          SERIAL_ERROR_MSG(MSG_ERR_HOTEND_TOO_COLD);
558 557
           #if ENABLED(SINGLENOZZLE)
559 558
             active_extruder = tmp_extruder;
560 559
             return;

+ 10
- 10
Marlin/src/pins/pinsDebug.h Прегледај датотеку

@@ -140,11 +140,11 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa
140 140
             if (pin == 46 || pin == 47) {
141 141
               if (pin == 46) {
142 142
                 print_input_or_output(GET_OUTPUT(46));
143
-                SERIAL_PROTOCOL(READ(46));
143
+                SERIAL_ECHO(READ(46));
144 144
               }
145 145
               else if (pin == 47) {
146 146
                 print_input_or_output(GET_OUTPUT(47));
147
-                SERIAL_PROTOCOL(READ(47));
147
+                SERIAL_ECHO(READ(47));
148 148
               }
149 149
             }
150 150
             else
@@ -160,14 +160,14 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa
160 160
                                                // because this could interfere with inductive/capacitive
161 161
                                                // sensors (high impedance voltage divider) and with PT100 amplifier
162 162
                 print_input_or_output(false);
163
-                SERIAL_PROTOCOL(digitalRead_mod(pin));
163
+                SERIAL_ECHO(digitalRead_mod(pin));
164 164
               }
165 165
               else if (pwm_status(pin)) {
166 166
                 // do nothing
167 167
               }
168 168
               else {
169 169
                 print_input_or_output(true);
170
-                SERIAL_PROTOCOL(digitalRead_mod(pin));
170
+                SERIAL_ECHO(digitalRead_mod(pin));
171 171
               }
172 172
             }
173 173
             if (!multi_name_pin && extended) pwm_details(pin);  // report PWM capabilities only on the first pass & only if doing an extended report
@@ -193,23 +193,23 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa
193 193
     if (extended) {
194 194
       #if AVR_AT90USB1286_FAMILY  //Teensy IDEs don't know about these pins so must use FASTIO
195 195
         if (pin == 46 || pin == 47) {
196
-          SERIAL_PROTOCOL_SP(12);
196
+          SERIAL_ECHO_SP(12);
197 197
           if (pin == 46) {
198 198
             print_input_or_output(GET_OUTPUT(46));
199
-            SERIAL_PROTOCOL(READ(46));
199
+            SERIAL_ECHO(READ(46));
200 200
           }
201 201
           else {
202 202
             print_input_or_output(GET_OUTPUT(47));
203
-            SERIAL_PROTOCOL(READ(47));
203
+            SERIAL_ECHO(READ(47));
204 204
           }
205 205
         }
206 206
         else
207 207
       #endif
208 208
       {
209 209
         if (GET_PINMODE(pin)) {
210
-          SERIAL_PROTOCOL_SP(MAX_NAME_LENGTH - 16);
210
+          SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16);
211 211
           print_input_or_output(true);
212
-          SERIAL_PROTOCOL(digitalRead_mod(pin));
212
+          SERIAL_ECHO(digitalRead_mod(pin));
213 213
         }
214 214
         else {
215 215
           if (IS_ANALOG(pin)) {
@@ -221,7 +221,7 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa
221 221
           SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16);   // add padding if not an analog pin
222 222
 
223 223
           print_input_or_output(false);
224
-          SERIAL_PROTOCOL(digitalRead_mod(pin));
224
+          SERIAL_ECHO(digitalRead_mod(pin));
225 225
         }
226 226
         //if (!pwm_status(pin)) SERIAL_CHAR(' ');    // add padding if it's not a PWM pin
227 227
         if (extended) pwm_details(pin);  // report PWM capabilities only if doing an extended report

+ 1
- 1
Marlin/src/sd/SdBaseFile.cpp Прегледај датотеку

@@ -905,7 +905,7 @@ int SdBaseFile::peek() {
905 905
 // print uint8_t with width 2
906 906
 static void print2u(const uint8_t v) {
907 907
   if (v < 10) SERIAL_CHAR('0');
908
-  SERIAL_ECHO_F(v, DEC);
908
+  SERIAL_ECHO(int(v));
909 909
 }
910 910
 
911 911
 /**

+ 1
- 1
Marlin/src/sd/SdBaseFile.h Прегледај датотеку

@@ -108,7 +108,7 @@ static inline uint16_t FAT_YEAR(uint16_t fatDate) { return 1980 + (fatDate >> 9)
108 108
  *
109 109
  * \return Extracted month [1,12]
110 110
  */
111
-static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0XF; }
111
+static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0xF; }
112 112
 
113 113
 /**
114 114
  * day part of FAT directory date field

+ 41
- 56
Marlin/src/sd/cardreader.cpp Прегледај датотеку

@@ -228,10 +228,10 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
228 228
 
229 229
         case LS_SerialPrint:
230 230
           createFilename(filename, p);
231
-          if (prepend) SERIAL_PROTOCOL_P(port, prepend);
232
-          SERIAL_PROTOCOL_P(port, filename);
233
-          SERIAL_PROTOCOLCHAR_P(port, ' ');
234
-          SERIAL_PROTOCOLLN_P(port, p.fileSize);
231
+          if (prepend) SERIAL_ECHO_P(port, prepend);
232
+          SERIAL_ECHO_P(port, filename);
233
+          SERIAL_CHAR_P(port, ' ');
234
+          SERIAL_ECHOLN_P(port, p.fileSize);
235 235
           break;
236 236
 
237 237
         case LS_GetFilename:
@@ -305,8 +305,8 @@ void CardReader::ls(
305 305
       );
306 306
 
307 307
       // Print /LongNamePart to serial output
308
-      SERIAL_PROTOCOLCHAR_P(port, '/');
309
-      SERIAL_PROTOCOL_P(port, longFilename[0] ? longFilename : "???");
308
+      SERIAL_CHAR_P(port, '/');
309
+      SERIAL_ECHO_P(port, longFilename[0] ? longFilename : "???");
310 310
 
311 311
       // If the filename was printed then that's it
312 312
       if (!flag.filenameIsDir) break;
@@ -373,21 +373,15 @@ void CardReader::initsd() {
373 373
     #endif
374 374
   ) {
375 375
     //if (!sd2card.init(SPI_HALF_SPEED,SDSS))
376
-    SERIAL_ECHO_START();
377
-    SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL);
378
-  }
379
-  else if (!volume.init(&sd2card)) {
380
-    SERIAL_ERROR_START();
381
-    SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL);
382
-  }
383
-  else if (!root.openRoot(&volume)) {
384
-    SERIAL_ERROR_START();
385
-    SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL);
376
+    SERIAL_ECHO_MSG(MSG_SD_INIT_FAIL);
386 377
   }
378
+  else if (!volume.init(&sd2card))
379
+    SERIAL_ERROR_MSG(MSG_SD_VOL_INIT_FAIL);
380
+  else if (!root.openRoot(&volume))
381
+    SERIAL_ERROR_MSG(MSG_SD_OPENROOT_FAIL);
387 382
   else {
388 383
     flag.cardOK = true;
389
-    SERIAL_ECHO_START();
390
-    SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
384
+    SERIAL_ECHO_MSG(MSG_SD_CARD_OK);
391 385
   }
392 386
   setroot();
393 387
 }
@@ -462,9 +456,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall
462 456
   if (isFileOpen()) {                     // Replacing current file or doing a subroutine
463 457
     if (subcall) {
464 458
       if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
465
-        SERIAL_ERROR_START();
466
-        SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
467
-        SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH);
459
+        SERIAL_ERROR_MSG("trying to call sub-gcode files with too many levels. MAX level is:" STRINGIFY(SD_PROCEDURE_DEPTH));
468 460
         kill();
469 461
         return;
470 462
       }
@@ -482,10 +474,8 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall
482 474
     else
483 475
       doing = 1;
484 476
   }
485
-  else if (subcall) {     // Returning from a subcall?
486
-    SERIAL_ECHO_START();
487
-    SERIAL_ECHOLNPGM("END SUBROUTINE");
488
-  }
477
+  else if (subcall)       // Returning from a subcall?
478
+    SERIAL_ECHO_MSG("END SUBROUTINE");
489 479
   else {                  // Opening fresh file
490 480
     doing = 2;
491 481
     file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure
@@ -508,26 +498,26 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall
508 498
     if (file.open(curDir, fname, O_READ)) {
509 499
       filesize = file.fileSize();
510 500
       sdpos = 0;
511
-      SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname);
512
-      SERIAL_PROTOCOLLNPAIR(MSG_SD_SIZE, filesize);
513
-      SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
501
+      SERIAL_ECHOPAIR(MSG_SD_FILE_OPENED, fname);
502
+      SERIAL_ECHOLNPAIR(MSG_SD_SIZE, filesize);
503
+      SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED);
514 504
 
515 505
       getfilename(0, fname);
516 506
       ui.set_status(longFilename[0] ? longFilename : fname);
517 507
       //if (longFilename[0]) {
518
-      //  SERIAL_PROTOCOLPAIR(MSG_SD_FILE_LONG_NAME, longFilename);
508
+      //  SERIAL_ECHOPAIR(MSG_SD_FILE_LONG_NAME, longFilename);
519 509
       //}
520 510
     }
521 511
     else {
522
-      SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
523
-      SERIAL_PROTOCOLCHAR('.');
512
+      SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
513
+      SERIAL_CHAR('.');
524 514
       SERIAL_EOL();
525 515
     }
526 516
   }
527 517
   else { //write
528 518
     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
529
-      SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
530
-      SERIAL_PROTOCOLCHAR('.');
519
+      SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
520
+      SERIAL_CHAR('.');
531 521
       SERIAL_EOL();
532 522
     }
533 523
     else {
@@ -536,7 +526,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall
536 526
       #if ENABLED(EMERGENCY_PARSER)
537 527
         emergency_parser.disable();
538 528
       #endif
539
-      SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, fname);
529
+      SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname);
540 530
       ui.set_status(fname);
541 531
     }
542 532
   }
@@ -552,17 +542,15 @@ void CardReader::removeFile(const char * const name) {
552 542
   if (!fname) return;
553 543
 
554 544
   if (file.remove(curDir, fname)) {
555
-    SERIAL_PROTOCOLPGM("File deleted:");
556
-    SERIAL_PROTOCOLLN(fname);
545
+    SERIAL_ECHOLNPAIR("File deleted:", fname);
557 546
     sdpos = 0;
558 547
     #if ENABLED(SDCARD_SORT_ALPHA)
559 548
       presort();
560 549
     #endif
561 550
   }
562 551
   else {
563
-    SERIAL_PROTOCOLPGM("Deletion failed, File: ");
564
-    SERIAL_PROTOCOL(fname);
565
-    SERIAL_PROTOCOLCHAR('.');
552
+    SERIAL_ECHOPAIR("Deletion failed, File: ", fname);
553
+    SERIAL_CHAR('.');
566 554
   }
567 555
 }
568 556
 
@@ -572,13 +560,13 @@ void CardReader::getStatus(
572 560
   #endif
573 561
 ) {
574 562
   if (flag.cardOK && flag.sdprinting) {
575
-    SERIAL_PROTOCOLPGM_P(port, MSG_SD_PRINTING_BYTE);
576
-    SERIAL_PROTOCOL_P(port, sdpos);
577
-    SERIAL_PROTOCOLCHAR_P(port, '/');
578
-    SERIAL_PROTOCOLLN_P(port, filesize);
563
+    SERIAL_ECHOPGM_P(port, MSG_SD_PRINTING_BYTE);
564
+    SERIAL_ECHO_P(port, sdpos);
565
+    SERIAL_CHAR_P(port, '/');
566
+    SERIAL_ECHOLN_P(port, filesize);
579 567
   }
580 568
   else
581
-    SERIAL_PROTOCOLLNPGM_P(port, MSG_SD_NOT_PRINTING);
569
+    SERIAL_ECHOLNPGM_P(port, MSG_SD_NOT_PRINTING);
582 570
 }
583 571
 
584 572
 void CardReader::write_command(char *buf) {
@@ -595,10 +583,8 @@ void CardReader::write_command(char *buf) {
595 583
   end[2] = '\n';
596 584
   end[3] = '\0';
597 585
   file.write(begin);
598
-  if (file.writeError) {
599
-    SERIAL_ERROR_START();
600
-    SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE);
601
-  }
586
+
587
+  if (file.writeError) SERIAL_ERROR_MSG(MSG_SD_ERR_WRITE_TO_FILE);
602 588
 }
603 589
 
604 590
 //
@@ -715,8 +701,8 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con
715 701
     if (echo) SERIAL_ECHOLN(dosSubdirname);
716 702
 
717 703
     if (!myDir.open(curDir, dosSubdirname, O_READ)) {
718
-      SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname);
719
-      SERIAL_PROTOCOLCHAR('.');
704
+      SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname);
705
+      SERIAL_CHAR('.');
720 706
       SERIAL_EOL();
721 707
       return NULL;
722 708
     }
@@ -740,8 +726,7 @@ void CardReader::chdir(const char * relpath) {
740 726
   }
741 727
   else {
742 728
     SERIAL_ECHO_START();
743
-    SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
744
-    SERIAL_ECHOLN(relpath);
729
+    SERIAL_ECHOLNPAIR(MSG_SD_CANT_ENTER_SUBDIR, relpath);
745 730
   }
746 731
 }
747 732
 
@@ -1081,12 +1066,12 @@ void CardReader::printingHasFinished() {
1081 1066
     if (!flag.cardOK) return;
1082 1067
     if (recovery.file.isOpen()) return;
1083 1068
     if (!recovery.file.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) {
1084
-      SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name);
1085
-      SERIAL_PROTOCOLCHAR('.');
1069
+      SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name);
1070
+      SERIAL_CHAR('.');
1086 1071
       SERIAL_EOL();
1087 1072
     }
1088 1073
     else if (!read)
1089
-      SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name);
1074
+      SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name);
1090 1075
   }
1091 1076
 
1092 1077
   // Removing the job recovery file currently requires closing
@@ -1097,7 +1082,7 @@ void CardReader::printingHasFinished() {
1097 1082
       //closefile();
1098 1083
       removeFile(job_recovery_file_name);
1099 1084
       #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
1100
-        SERIAL_PROTOCOLPGM("Power-loss file delete");
1085
+        SERIAL_ECHOPGM("Power-loss file delete");
1101 1086
         serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n"));
1102 1087
       #endif
1103 1088
     }

Loading…
Откажи
Сачувај