Browse Source

Use new serial spacing function to save PROGMEM

Scott Lahteine 8 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
     // looking for port B7 - PWMs 0A and 1C
409
     // looking for port B7 - PWMs 0A and 1C
410
     if ( ('B' == digitalPinToPort(pin) + 64) && (0x80 == digitalPinToBitMask(pin))) {
410
     if ( ('B' == digitalPinToPort(pin) + 64) && (0x80 == digitalPinToBitMask(pin))) {
411
       #ifndef TEENSYDUINO_IDE
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
       #else
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
       #endif
423
       #endif
418
     }
424
     }
419
   #endif
425
   #endif
437
     for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
443
     for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
438
     SERIAL_CHAR(x);
444
     SERIAL_CHAR(x);
439
   #else
445
   #else
440
-    SERIAL_PROTOCOLPGM("          ");
446
+    SERIAL_PROTOCOL_SP(10);
441
   #endif
447
   #endif
442
 }
448
 }
443
 
449
 
460
           sprintf(buffer, " (A%2d)  ", int(pin - analogInputToDigitalPin(0)));    // analog pin number
466
           sprintf(buffer, " (A%2d)  ", int(pin - analogInputToDigitalPin(0)));    // analog pin number
461
           SERIAL_ECHO(buffer);
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
       else SERIAL_ECHOPGM(".                         ");  // add padding if not the first instance found
475
       else SERIAL_ECHOPGM(".                         ");  // add padding if not the first instance found
466
       name_mem_pointer = (char*) pgm_read_word(&pin_array[x][0]);
476
       name_mem_pointer = (char*) pgm_read_word(&pin_array[x][0]);
506
       SERIAL_ECHO(buffer);
516
       SERIAL_ECHO(buffer);
507
     }
517
     }
508
     else
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
     SERIAL_ECHOPGM("<unused/unknown>");
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
     else {
525
     else {
514
       if (IS_ANALOG(pin)) {
526
       if (IS_ANALOG(pin)) {
515
         sprintf(buffer, "   Analog in = %5d", analogRead(pin - analogInputToDigitalPin(0)));
527
         sprintf(buffer, "   Analog in = %5d", analogRead(pin - analogInputToDigitalPin(0)));
516
         SERIAL_ECHO(buffer);
528
         SERIAL_ECHO(buffer);
517
       }
529
       }
518
       else
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
       SERIAL_PROTOCOLPAIR("   Input  = ", digitalRead_mod(pin));
533
       SERIAL_PROTOCOLPAIR("   Input  = ", digitalRead_mod(pin));
522
     }
534
     }

+ 3
- 3
Marlin/ubl.cpp View File

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

Loading…
Cancel
Save