Browse Source

Use new serial spacing function to save PROGMEM

Scott Lahteine 7 years ago
parent
commit
42824b0e1f
2 changed files with 25 additions and 13 deletions
  1. 22
    10
      Marlin/pinsDebug.h
  2. 3
    3
      Marlin/ubl.cpp

+ 22
- 10
Marlin/pinsDebug.h View File

@@ -409,11 +409,17 @@ static void pwm_details(uint8_t pin) {
409 409
     // looking for port B7 - PWMs 0A and 1C
410 410
     if ( ('B' == digitalPinToPort(pin) + 64) && (0x80 == digitalPinToBitMask(pin))) {
411 411
       #ifndef TEENSYDUINO_IDE
412
-        SERIAL_PROTOCOLPGM("\n .                  TIMER1C is also tied to this pin             ");
413
-        timer_prefix(1,'C',4);
412
+        SERIAL_PROTOCOLPGM("\n .");
413
+        SERIAL_PROTOCOL_SP(18);
414
+        SERIAL_PROTOCOLPGM("TIMER1C is also tied to this pin");
415
+        SERIAL_PROTOCOL_SP(13);
416
+        timer_prefix(1, 'C', 4);
414 417
       #else
415
-        SERIAL_PROTOCOLPGM("\n .                  TIMER0A is also tied to this pin             ");
416
-        timer_prefix(0,'A',3);
418
+        SERIAL_PROTOCOLPGM("\n .");
419
+        SERIAL_PROTOCOL_SP(18);
420
+        SERIAL_PROTOCOLPGM("TIMER0A is also tied to this pin");
421
+        SERIAL_PROTOCOL_SP(13);
422
+        timer_prefix(0, 'A', 3);
417 423
       #endif
418 424
     }
419 425
   #endif
@@ -437,7 +443,7 @@ void print_port(int8_t pin) {   // print port number
437 443
     for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
438 444
     SERIAL_CHAR(x);
439 445
   #else
440
-    SERIAL_PROTOCOLPGM("          ");
446
+    SERIAL_PROTOCOL_SP(10);
441 447
   #endif
442 448
 }
443 449
 
@@ -460,7 +466,11 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = t
460 466
           sprintf(buffer, " (A%2d)  ", int(pin - analogInputToDigitalPin(0)));    // analog pin number
461 467
           SERIAL_ECHO(buffer);
462 468
         }
463
-        else SERIAL_ECHOPGM("        ");   // add padding if not an analog pin
469
+        else SERIAL_ECHO_SP(8);   // add padding if not an analog pin
470
+      }
471
+      else {
472
+        SERIAL_CHAR('.');
473
+        SERIAL_ECHO_SP(25);  // add padding if not the first instance found
464 474
       }
465 475
       else SERIAL_ECHOPGM(".                         ");  // add padding if not the first instance found
466 476
       name_mem_pointer = (char*) pgm_read_word(&pin_array[x][0]);
@@ -506,17 +516,19 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = t
506 516
       SERIAL_ECHO(buffer);
507 517
     }
508 518
     else
509
-      SERIAL_ECHOPGM("        ");   // add padding if not an analog pin
519
+      SERIAL_ECHO_SP(8);   // add padding if not an analog pin
510 520
     SERIAL_ECHOPGM("<unused/unknown>");
511
-    if (get_pinMode(pin))
512
-      SERIAL_PROTOCOLPAIR("            Output = ", digitalRead_mod(pin));
521
+    if (get_pinMode(pin)) {
522
+      SERIAL_PROTOCOL_SP(12);
523
+      SERIAL_PROTOCOLPAIR("Output = ", digitalRead_mod(pin));
524
+    }
513 525
     else {
514 526
       if (IS_ANALOG(pin)) {
515 527
         sprintf(buffer, "   Analog in = %5d", analogRead(pin - analogInputToDigitalPin(0)));
516 528
         SERIAL_ECHO(buffer);
517 529
       }
518 530
       else
519
-        SERIAL_ECHOPGM("         ");   // add padding if not an analog pin
531
+        SERIAL_ECHO_SP(9);   // add padding if not an analog pin
520 532
 
521 533
       SERIAL_PROTOCOLPAIR("   Input  = ", digitalRead_mod(pin));
522 534
     }

+ 3
- 3
Marlin/ubl.cpp View File

@@ -52,7 +52,7 @@
52 52
 
53 53
   static void serial_echo_12x_spaces() {
54 54
     for (uint8_t i = GRID_MAX_POINTS_X - 1; --i;) {
55
-      SERIAL_ECHOPGM("            ");
55
+      SERIAL_ECHO_SP(12);
56 56
       safe_delay(10);
57 57
     }
58 58
   }
@@ -201,12 +201,12 @@
201 201
 
202 202
     if (map0) {
203 203
       serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y);
204
-      SERIAL_ECHOPGM("    ");
204
+      SERIAL_ECHO_SP(4);
205 205
       serial_echo_12x_spaces();
206 206
       serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MIN_Y);
207 207
       SERIAL_EOL;
208 208
       serial_echo_xy(0, 0);
209
-      SERIAL_ECHOPGM("       ");
209
+      SERIAL_ECHO_SP(7);
210 210
       serial_echo_12x_spaces();
211 211
       serial_echo_xy(GRID_MAX_POINTS_X - 1, 0);
212 212
       SERIAL_EOL;

Loading…
Cancel
Save