Browse Source

Fix some serial char, echo

Co-Authored-By: X-Ryl669 <3277165+X-Ryl669@users.noreply.github.com>
Scott Lahteine 4 years ago
parent
commit
604afd52d1

+ 2
- 2
Marlin/src/HAL/shared/backtrace/backtrace.cpp View File

34
 
34
 
35
   (*p)++;
35
   (*p)++;
36
 
36
 
37
-  SERIAL_CHAR('#'); SERIAL_PRINT(*p, DEC); SERIAL_ECHOPGM(" : ");
37
+  SERIAL_CHAR('#'); SERIAL_ECHO(*p); SERIAL_ECHOPGM(" : ");
38
   SERIAL_ECHOPGM(bte->name ? bte->name : "unknown"); SERIAL_ECHOPGM("@0x"); SERIAL_PRINT(bte->function, HEX);
38
   SERIAL_ECHOPGM(bte->name ? bte->name : "unknown"); SERIAL_ECHOPGM("@0x"); SERIAL_PRINT(bte->function, HEX);
39
-  SERIAL_CHAR('+'); SERIAL_PRINT(bte->address - bte->function,DEC);
39
+  SERIAL_CHAR('+'); SERIAL_ECHO(bte->address - bte->function);
40
   SERIAL_ECHOPGM(" PC:"); SERIAL_PRINT(bte->address,HEX); SERIAL_CHAR('\n');
40
   SERIAL_ECHOPGM(" PC:"); SERIAL_PRINT(bte->address,HEX); SERIAL_CHAR('\n');
41
   return true;
41
   return true;
42
 }
42
 }

+ 1
- 1
Marlin/src/feature/bedlevel/bedlevel.cpp View File

196
         #endif
196
         #endif
197
       }
197
       }
198
       #ifdef SCAD_MESH_OUTPUT
198
       #ifdef SCAD_MESH_OUTPUT
199
-        SERIAL_CHAR(' ', ']');            // close sub-array
199
+        SERIAL_ECHOPGM(" ]");            // close sub-array
200
         if (y < sy - 1) SERIAL_CHAR(',');
200
         if (y < sy - 1) SERIAL_CHAR(',');
201
       #endif
201
       #endif
202
       SERIAL_EOL();
202
       SERIAL_EOL();

+ 3
- 3
Marlin/src/feature/direct_stepping.cpp View File

180
     if (!page_states_dirty) return;
180
     if (!page_states_dirty) return;
181
     page_states_dirty = false;
181
     page_states_dirty = false;
182
 
182
 
183
-    SERIAL_ECHO(Cfg::CONTROL_CHAR);
183
+    SERIAL_CHAR(Cfg::CONTROL_CHAR);
184
     constexpr int state_bits = 2;
184
     constexpr int state_bits = 2;
185
     constexpr int n_bytes = Cfg::NUM_PAGES >> state_bits;
185
     constexpr int n_bytes = Cfg::NUM_PAGES >> state_bits;
186
     volatile uint8_t bits_b[n_bytes] = { 0 };
186
     volatile uint8_t bits_b[n_bytes] = { 0 };
192
     uint8_t crc = 0;
192
     uint8_t crc = 0;
193
     for (uint8_t i = 0 ; i < n_bytes ; i++) {
193
     for (uint8_t i = 0 ; i < n_bytes ; i++) {
194
       crc ^= bits_b[i];
194
       crc ^= bits_b[i];
195
-      SERIAL_ECHO(bits_b[i]);
195
+      SERIAL_CHAR(bits_b[i]);
196
     }
196
     }
197
 
197
 
198
-    SERIAL_ECHO(crc);
198
+    SERIAL_CHAR(crc);
199
     SERIAL_EOL();
199
     SERIAL_EOL();
200
   }
200
   }
201
 
201
 

+ 11
- 12
Marlin/src/feature/encoder_i2c.cpp View File

172
             float sumP = 0;
172
             float sumP = 0;
173
             LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
173
             LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i];
174
             const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
174
             const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE));
175
-            SERIAL_ECHO(axis_codes[encoderAxis]);
175
+            SERIAL_CHAR(axis_codes[encoderAxis]);
176
             SERIAL_ECHOLNPAIR(" : CORRECT ERR ", errorP * planner.steps_to_mm[encoderAxis], "mm");
176
             SERIAL_ECHOLNPAIR(" : CORRECT ERR ", errorP * planner.steps_to_mm[encoderAxis], "mm");
177
             babystep.add_steps(encoderAxis, -LROUND(errorP));
177
             babystep.add_steps(encoderAxis, -LROUND(errorP));
178
             errPrstIdx = 0;
178
             errPrstIdx = 0;
192
     if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
192
     if (ABS(error) > I2CPE_ERR_CNT_THRESH * planner.settings.axis_steps_per_mm[encoderAxis]) {
193
       const millis_t ms = millis();
193
       const millis_t ms = millis();
194
       if (ELAPSED(ms, nextErrorCountTime)) {
194
       if (ELAPSED(ms, nextErrorCountTime)) {
195
-        SERIAL_ECHO(axis_codes[encoderAxis]);
195
+        SERIAL_CHAR(axis_codes[encoderAxis]);
196
         SERIAL_ECHOLNPAIR(" : LARGE ERR ", int(error), "; diffSum=", diffSum);
196
         SERIAL_ECHOLNPAIR(" : LARGE ERR ", int(error), "; diffSum=", diffSum);
197
         errorCount++;
197
         errorCount++;
198
         nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
198
         nextErrorCountTime = ms + I2CPE_ERR_CNT_DEBOUNCE_MS;
213
     trusted++;
213
     trusted++;
214
 
214
 
215
     #ifdef I2CPE_DEBUG
215
     #ifdef I2CPE_DEBUG
216
-      SERIAL_ECHO(axis_codes[encoderAxis]);
216
+      SERIAL_CHAR(axis_codes[encoderAxis]);
217
       SERIAL_ECHOLNPAIR(" axis encoder homed, offset of ", zeroOffset, " ticks.");
217
       SERIAL_ECHOLNPAIR(" axis encoder homed, offset of ", zeroOffset, " ticks.");
218
     #endif
218
     #endif
219
   }
219
   }
224
   homed = trusted = false;
224
   homed = trusted = false;
225
 
225
 
226
   #ifdef I2CPE_DEBUG
226
   #ifdef I2CPE_DEBUG
227
-    SERIAL_ECHO(axis_codes[encoderAxis]);
227
+    SERIAL_CHAR(axis_codes[encoderAxis]);
228
     SERIAL_ECHOLNPGM(" axis encoder unhomed.");
228
     SERIAL_ECHOLNPGM(" axis encoder unhomed.");
229
   #endif
229
   #endif
230
 }
230
 }
232
 bool I2CPositionEncoder::passes_test(const bool report) {
232
 bool I2CPositionEncoder::passes_test(const bool report) {
233
   if (report) {
233
   if (report) {
234
     if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. ");
234
     if (H != I2CPE_MAG_SIG_GOOD) SERIAL_ECHOPGM("Warning. ");
235
-    SERIAL_ECHO(axis_codes[encoderAxis]);
235
+    SERIAL_CHAR(axis_codes[encoderAxis]);
236
     serial_ternary(H == I2CPE_MAG_SIG_BAD, PSTR(" axis "), PSTR("magnetic strip "), PSTR("encoder "));
236
     serial_ternary(H == I2CPE_MAG_SIG_BAD, PSTR(" axis "), PSTR("magnetic strip "), PSTR("encoder "));
237
     switch (H) {
237
     switch (H) {
238
       case I2CPE_MAG_SIG_GOOD:
238
       case I2CPE_MAG_SIG_GOOD:
253
               error = ABS(diff) > 10000 ? 0 : diff; // Huge error is a bad reading
253
               error = ABS(diff) > 10000 ? 0 : diff; // Huge error is a bad reading
254
 
254
 
255
   if (report) {
255
   if (report) {
256
-    SERIAL_ECHO(axis_codes[encoderAxis]);
256
+    SERIAL_CHAR(axis_codes[encoderAxis]);
257
     SERIAL_ECHOLNPAIR(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
257
     SERIAL_ECHOLNPAIR(" axis target=", target, "mm; actual=", actual, "mm; err=", error, "mm");
258
   }
258
   }
259
 
259
 
263
 int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
263
 int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) {
264
   if (!active) {
264
   if (!active) {
265
     if (report) {
265
     if (report) {
266
-      SERIAL_ECHO(axis_codes[encoderAxis]);
266
+      SERIAL_CHAR(axis_codes[encoderAxis]);
267
       SERIAL_ECHOLNPGM(" axis encoder not active!");
267
       SERIAL_ECHOLNPGM(" axis encoder not active!");
268
     }
268
     }
269
     return 0;
269
     return 0;
288
   errorPrev = error;
288
   errorPrev = error;
289
 
289
 
290
   if (report) {
290
   if (report) {
291
-    SERIAL_ECHO(axis_codes[encoderAxis]);
291
+    SERIAL_CHAR(axis_codes[encoderAxis]);
292
     SERIAL_ECHOLNPAIR(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
292
     SERIAL_ECHOLNPAIR(" axis target=", target, "; actual=", encoderCountInStepperTicksScaled, "; err=", error);
293
   }
293
   }
294
 
294
 
667
   else {
667
   else {
668
     if (noOffset) {
668
     if (noOffset) {
669
       const int32_t raw_count = encoders[idx].get_raw_count();
669
       const int32_t raw_count = encoders[idx].get_raw_count();
670
-      SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]);
671
-      SERIAL_CHAR(' ');
670
+      SERIAL_CHAR(axis_codes[encoders[idx].get_axis()], ' ');
672
 
671
 
673
       for (uint8_t j = 31; j > 0; j--)
672
       for (uint8_t j = 31; j > 0; j--)
674
         SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j)));
673
         SERIAL_ECHO((bool)(0x00000001 & (raw_count >> j)));
723
   // and enable it (it will likely have failed initialization on power-up, before the address change).
722
   // and enable it (it will likely have failed initialization on power-up, before the address change).
724
   const int8_t idx = idx_from_addr(newaddr);
723
   const int8_t idx = idx_from_addr(newaddr);
725
   if (idx >= 0 && !encoders[idx].get_active()) {
724
   if (idx >= 0 && !encoders[idx].get_active()) {
726
-    SERIAL_ECHO(axis_codes[encoders[idx].get_axis()]);
725
+    SERIAL_CHAR(axis_codes[encoders[idx].get_axis()]);
727
     SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again.");
726
     SERIAL_ECHOLNPGM(" axis encoder was not detected on printer startup. Trying again.");
728
     encoders[idx].set_active(encoders[idx].passes_test(true));
727
     encoders[idx].set_active(encoders[idx].passes_test(true));
729
   }
728
   }
748
   if (Wire.requestFrom(I2C_ADDRESS(address), uint8_t(32))) {
747
   if (Wire.requestFrom(I2C_ADDRESS(address), uint8_t(32))) {
749
     char c;
748
     char c;
750
     while (Wire.available() > 0 && (c = (char)Wire.read()) > 0)
749
     while (Wire.available() > 0 && (c = (char)Wire.read()) > 0)
751
-      SERIAL_ECHO(c);
750
+      SERIAL_CHAR(c);
752
     SERIAL_EOL();
751
     SERIAL_EOL();
753
   }
752
   }
754
 
753
 

+ 32
- 32
Marlin/src/feature/tmc_util.cpp View File

233
   void report_polled_driver_data(TMC &st, const TMC_driver_data &data) {
233
   void report_polled_driver_data(TMC &st, const TMC_driver_data &data) {
234
     const uint32_t pwm_scale = get_pwm_scale(st);
234
     const uint32_t pwm_scale = get_pwm_scale(st);
235
     st.printLabel();
235
     st.printLabel();
236
-    SERIAL_CHAR(':'); SERIAL_PRINT(pwm_scale, DEC);
236
+    SERIAL_CHAR(':'); SERIAL_ECHO(pwm_scale);
237
     #if ENABLED(TMC_DEBUG)
237
     #if ENABLED(TMC_DEBUG)
238
       #if HAS_TMCX1X0 || HAS_TMC220x
238
       #if HAS_TMCX1X0 || HAS_TMC220x
239
-        SERIAL_CHAR('/'); SERIAL_PRINT(data.cs_actual, DEC);
239
+        SERIAL_CHAR('/'); SERIAL_ECHO(data.cs_actual);
240
       #endif
240
       #endif
241
       #if HAS_STALLGUARD
241
       #if HAS_STALLGUARD
242
         SERIAL_CHAR('/');
242
         SERIAL_CHAR('/');
257
     #endif
257
     #endif
258
     if (st.flag_otpw)         SERIAL_CHAR('F'); // otpw Flag
258
     if (st.flag_otpw)         SERIAL_CHAR('F'); // otpw Flag
259
     SERIAL_CHAR('|');
259
     SERIAL_CHAR('|');
260
-    if (st.otpw_count > 0) SERIAL_PRINT(st.otpw_count, DEC);
260
+    if (st.otpw_count > 0) SERIAL_ECHO(st.otpw_count);
261
     SERIAL_CHAR('\t');
261
     SERIAL_CHAR('\t');
262
   }
262
   }
263
 
263
 
551
   #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC5130)
551
   #if HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC5130)
552
     static void _tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) {
552
     static void _tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) {
553
       switch (i) {
553
       switch (i) {
554
-        case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break;
555
-        case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break;
554
+        case TMC_PWM_SCALE: SERIAL_ECHO(st.PWM_SCALE()); break;
555
+        case TMC_SGT: SERIAL_ECHO(st.sgt()); break;
556
         case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break;
556
         case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break;
557
         case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
557
         case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
558
         default: break;
558
         default: break;
563
     static void _tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) {
563
     static void _tmc_parse_drv_status(TMC2130Stepper &st, const TMC_drv_status_enum i) {
564
       switch (i) {
564
       switch (i) {
565
         case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('*'); break;
565
         case TMC_STALLGUARD: if (st.stallguard()) SERIAL_CHAR('*'); break;
566
-        case TMC_SG_RESULT:  SERIAL_PRINT(st.sg_result(), DEC); break;
566
+        case TMC_SG_RESULT:  SERIAL_ECHO(st.sg_result()); break;
567
         case TMC_FSACTIVE:   if (st.fsactive())   SERIAL_CHAR('*'); break;
567
         case TMC_FSACTIVE:   if (st.fsactive())   SERIAL_CHAR('*'); break;
568
-        case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break;
568
+        case TMC_DRV_CS_ACTUAL: SERIAL_ECHO(st.cs_actual()); break;
569
         default: break;
569
         default: break;
570
       }
570
       }
571
     }
571
     }
580
 
580
 
581
     static void _tmc_status(TMC2160Stepper &st, const TMC_debug_enum i) {
581
     static void _tmc_status(TMC2160Stepper &st, const TMC_debug_enum i) {
582
       switch (i) {
582
       switch (i) {
583
-        case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break;
584
-        case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break;
583
+        case TMC_PWM_SCALE: SERIAL_ECHO(st.PWM_SCALE()); break;
584
+        case TMC_SGT: SERIAL_ECHO(st.sgt()); break;
585
         case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break;
585
         case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break;
586
         case TMC_GLOBAL_SCALER:
586
         case TMC_GLOBAL_SCALER:
587
           {
587
           {
588
             uint16_t value = st.GLOBAL_SCALER();
588
             uint16_t value = st.GLOBAL_SCALER();
589
-            SERIAL_PRINT(value ?: 256, DEC);
589
+            SERIAL_ECHO(value ? value : 256);
590
             SERIAL_ECHOPGM("/256");
590
             SERIAL_ECHOPGM("/256");
591
           }
591
           }
592
           break;
592
           break;
599
   #if HAS_TMC220x
599
   #if HAS_TMC220x
600
     static void _tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) {
600
     static void _tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) {
601
       switch (i) {
601
       switch (i) {
602
-        case TMC_PWM_SCALE_SUM: SERIAL_PRINT(st.pwm_scale_sum(), DEC); break;
603
-        case TMC_PWM_SCALE_AUTO: SERIAL_PRINT(st.pwm_scale_auto(), DEC); break;
604
-        case TMC_PWM_OFS_AUTO: SERIAL_PRINT(st.pwm_ofs_auto(), DEC); break;
605
-        case TMC_PWM_GRAD_AUTO: SERIAL_PRINT(st.pwm_grad_auto(), DEC); break;
602
+        case TMC_PWM_SCALE_SUM: SERIAL_ECHO(st.pwm_scale_sum()); break;
603
+        case TMC_PWM_SCALE_AUTO: SERIAL_ECHO(st.pwm_scale_auto()); break;
604
+        case TMC_PWM_OFS_AUTO: SERIAL_ECHO(st.pwm_ofs_auto()); break;
605
+        case TMC_PWM_GRAD_AUTO: SERIAL_ECHO(st.pwm_grad_auto()); break;
606
         case TMC_STEALTHCHOP: serialprint_truefalse(st.stealth()); break;
606
         case TMC_STEALTHCHOP: serialprint_truefalse(st.stealth()); break;
607
         case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
607
         case TMC_INTERPOLATE: serialprint_truefalse(st.intpol()); break;
608
         default: break;
608
         default: break;
613
       template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
613
       template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
614
       static void _tmc_status(TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const TMC_debug_enum i) {
614
       static void _tmc_status(TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const TMC_debug_enum i) {
615
         switch (i) {
615
         switch (i) {
616
-          case TMC_SGT:       SERIAL_PRINT(st.SGTHRS(), DEC); break;
617
-          case TMC_UART_ADDR: SERIAL_PRINT(st.get_address(), DEC); break;
616
+          case TMC_SGT:       SERIAL_ECHO(st.SGTHRS()); break;
617
+          case TMC_UART_ADDR: SERIAL_ECHO(st.get_address()); break;
618
           default:
618
           default:
619
             TMC2208Stepper *parent = &st;
619
             TMC2208Stepper *parent = &st;
620
             _tmc_status(*parent, i);
620
             _tmc_status(*parent, i);
631
         case TMC_T120: if (st.t120()) SERIAL_CHAR('*'); break;
631
         case TMC_T120: if (st.t120()) SERIAL_CHAR('*'); break;
632
         case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break;
632
         case TMC_S2VSA: if (st.s2vsa()) SERIAL_CHAR('*'); break;
633
         case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break;
633
         case TMC_S2VSB: if (st.s2vsb()) SERIAL_CHAR('*'); break;
634
-        case TMC_DRV_CS_ACTUAL: SERIAL_PRINT(st.cs_actual(), DEC); break;
634
+        case TMC_DRV_CS_ACTUAL: SERIAL_ECHO(st.cs_actual()); break;
635
         default: break;
635
         default: break;
636
       }
636
       }
637
     }
637
     }
639
     #if HAS_DRIVER(TMC2209)
639
     #if HAS_DRIVER(TMC2209)
640
       static void _tmc_parse_drv_status(TMC2209Stepper &st, const TMC_drv_status_enum i) {
640
       static void _tmc_parse_drv_status(TMC2209Stepper &st, const TMC_drv_status_enum i) {
641
         switch (i) {
641
         switch (i) {
642
-          case TMC_SG_RESULT: SERIAL_PRINT(st.SG_RESULT(), DEC); break;
642
+          case TMC_SG_RESULT: SERIAL_ECHO(st.SG_RESULT()); break;
643
           default:            _tmc_parse_drv_status(static_cast<TMC2208Stepper &>(st), i); break;
643
           default:            _tmc_parse_drv_status(static_cast<TMC2208Stepper &>(st), i); break;
644
         }
644
         }
645
       }
645
       }
666
       case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break;
666
       case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break;
667
       case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break;
667
       case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break;
668
       case TMC_IRUN:
668
       case TMC_IRUN:
669
-        SERIAL_PRINT(st.irun(), DEC);
669
+        SERIAL_ECHO(st.irun());
670
         SERIAL_ECHOPGM("/31");
670
         SERIAL_ECHOPGM("/31");
671
         break;
671
         break;
672
       case TMC_IHOLD:
672
       case TMC_IHOLD:
673
-        SERIAL_PRINT(st.ihold(), DEC);
673
+        SERIAL_ECHO(st.ihold());
674
         SERIAL_ECHOPGM("/31");
674
         SERIAL_ECHOPGM("/31");
675
         break;
675
         break;
676
       case TMC_CS_ACTUAL:
676
       case TMC_CS_ACTUAL:
677
-        SERIAL_PRINT(st.cs_actual(), DEC);
677
+        SERIAL_ECHO(st.cs_actual());
678
         SERIAL_ECHOPGM("/31");
678
         SERIAL_ECHOPGM("/31");
679
         break;
679
         break;
680
       case TMC_VSENSE: print_vsense(st); break;
680
       case TMC_VSENSE: print_vsense(st); break;
694
       #if ENABLED(MONITOR_DRIVER_STATUS)
694
       #if ENABLED(MONITOR_DRIVER_STATUS)
695
         case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break;
695
         case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break;
696
       #endif
696
       #endif
697
-      case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break;
698
-      case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break;
699
-      case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break;
700
-      case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break;
701
-      case TMC_MSCNT: SERIAL_PRINT(st.get_microstep_counter(), DEC); break;
697
+      case TMC_TOFF: SERIAL_ECHO(st.toff()); break;
698
+      case TMC_TBL: SERIAL_ECHO(st.blank_time()); break;
699
+      case TMC_HEND: SERIAL_ECHO(st.hysteresis_end()); break;
700
+      case TMC_HSTRT: SERIAL_ECHO(st.hysteresis_start()); break;
701
+      case TMC_MSCNT: SERIAL_ECHO(st.get_microstep_counter()); break;
702
       default: _tmc_status(st, i); break;
702
       default: _tmc_status(st, i); break;
703
     }
703
     }
704
   }
704
   }
714
         case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break;
714
         case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break;
715
         case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break;
715
         case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break;
716
         case TMC_IRUN:
716
         case TMC_IRUN:
717
-          SERIAL_PRINT(st.cs(), DEC);
717
+          SERIAL_ECHO(st.cs());
718
           SERIAL_ECHOPGM("/31");
718
           SERIAL_ECHOPGM("/31");
719
           break;
719
           break;
720
         case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.165") : PSTR("0=.310")); break;
720
         case TMC_VSENSE: serialprintPGM(st.vsense() ? PSTR("1=.165") : PSTR("0=.310")); break;
721
         case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break;
721
         case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break;
722
         //case TMC_OTPW: serialprint_truefalse(st.otpw()); break;
722
         //case TMC_OTPW: serialprint_truefalse(st.otpw()); break;
723
         //case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break;
723
         //case TMC_OTPW_TRIGGERED: serialprint_truefalse(st.getOTPW()); break;
724
-        case TMC_SGT: SERIAL_PRINT(st.sgt(), DEC); break;
725
-        case TMC_TOFF: SERIAL_PRINT(st.toff(), DEC); break;
726
-        case TMC_TBL: SERIAL_PRINT(st.blank_time(), DEC); break;
727
-        case TMC_HEND: SERIAL_PRINT(st.hysteresis_end(), DEC); break;
728
-        case TMC_HSTRT: SERIAL_PRINT(st.hysteresis_start(), DEC); break;
724
+        case TMC_SGT: SERIAL_ECHO(st.sgt()); break;
725
+        case TMC_TOFF: SERIAL_ECHO(st.toff()); break;
726
+        case TMC_TBL: SERIAL_ECHO(st.blank_time()); break;
727
+        case TMC_HEND: SERIAL_ECHO(st.hysteresis_end()); break;
728
+        case TMC_HSTRT: SERIAL_ECHO(st.hysteresis_start()); break;
729
         default: break;
729
         default: break;
730
       }
730
       }
731
     }
731
     }

+ 1
- 1
Marlin/src/gcode/feature/advance/M900.cpp View File

43
 void GcodeSuite::M900() {
43
 void GcodeSuite::M900() {
44
 
44
 
45
   auto echo_value_oor = [](const char ltr, const bool ten=true) {
45
   auto echo_value_oor = [](const char ltr, const bool ten=true) {
46
-    SERIAL_CHAR('?'); SERIAL_CHAR(ltr);
46
+    SERIAL_CHAR('?', ltr);
47
     SERIAL_ECHOPGM(" value out of range");
47
     SERIAL_ECHOPGM(" value out of range");
48
     if (ten) SERIAL_ECHOPGM(" (0-10)");
48
     if (ten) SERIAL_ECHOPGM(" (0-10)");
49
     SERIAL_ECHOLNPGM(".");
49
     SERIAL_ECHOLNPGM(".");

+ 2
- 3
Marlin/src/gcode/queue.cpp View File

298
   #if ENABLED(ADVANCED_OK)
298
   #if ENABLED(ADVANCED_OK)
299
     char* p = command_buffer[index_r];
299
     char* p = command_buffer[index_r];
300
     if (*p == 'N') {
300
     if (*p == 'N') {
301
-      SERIAL_ECHO(' ');
302
-      SERIAL_ECHO(*p++);
301
+      SERIAL_CHAR(' ', *p++);
303
       while (NUMERIC_SIGNED(*p))
302
       while (NUMERIC_SIGNED(*p))
304
-        SERIAL_ECHO(*p++);
303
+        SERIAL_CHAR(*p++);
305
     }
304
     }
306
     SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free()),
305
     SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free()),
307
                       SP_B_STR, int(BUFSIZE - length));
306
                       SP_B_STR, int(BUFSIZE - length));

+ 2
- 5
Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp View File

141
 
141
 
142
 void AnycubicTFTClass::OnSDCardStateChange(bool isInserted) {
142
 void AnycubicTFTClass::OnSDCardStateChange(bool isInserted) {
143
   #if ENABLED(ANYCUBIC_LCD_DEBUG)
143
   #if ENABLED(ANYCUBIC_LCD_DEBUG)
144
-    SERIAL_ECHOPGM("TFT Serial Debug: OnSDCardStateChange event triggered...");
145
-    SERIAL_ECHO(ui8tostr2(isInserted));
146
-    SERIAL_EOL();
144
+    SERIAL_ECHOLNPAIR("TFT Serial Debug: OnSDCardStateChange event triggered...", (int)isInserted);
147
   #endif
145
   #endif
148
   DoSDCardStateCheck();
146
   DoSDCardStateCheck();
149
 }
147
 }
164
 
162
 
165
 void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) {
163
 void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) {
166
   #if ENABLED(ANYCUBIC_LCD_DEBUG)
164
   #if ENABLED(ANYCUBIC_LCD_DEBUG)
167
-    SERIAL_ECHOPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ");
168
-    SERIAL_ECHOLN(msg);
165
+    SERIAL_ECHOLNPAIR("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg);
169
   #endif
166
   #endif
170
 
167
 
171
   #if ENABLED(SDSUPPORT)
168
   #if ENABLED(SDSUPPORT)

+ 1
- 1
Marlin/src/sd/cardreader.cpp View File

369
     #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
369
     #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
370
       selectFileByName(dosFilename);
370
       selectFileByName(dosFilename);
371
       if (longFilename[0]) {
371
       if (longFilename[0]) {
372
-        SERIAL_ECHO(' ');
372
+        SERIAL_CHAR(' ');
373
         SERIAL_ECHO(longFilename);
373
         SERIAL_ECHO(longFilename);
374
       }
374
       }
375
     #endif
375
     #endif

Loading…
Cancel
Save