Browse Source

Add a function to output spaces to serial

Scott Lahteine 7 years ago
parent
commit
12ce051b55
2 changed files with 7 additions and 0 deletions
  1. 2
    0
      Marlin/serial.cpp
  2. 5
    0
      Marlin/serial.h

+ 2
- 0
Marlin/serial.cpp View File

32
 void serial_echopair_P(const char* s_P, float v)         { serialprintPGM(s_P); SERIAL_ECHO(v); }
32
 void serial_echopair_P(const char* s_P, float v)         { serialprintPGM(s_P); SERIAL_ECHO(v); }
33
 void serial_echopair_P(const char* s_P, double v)        { serialprintPGM(s_P); SERIAL_ECHO(v); }
33
 void serial_echopair_P(const char* s_P, double v)        { serialprintPGM(s_P); SERIAL_ECHO(v); }
34
 void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
34
 void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
35
+
36
+void serial_spaces(uint8_t count) { while (count--) MYSERIAL.write(' '); }

+ 5
- 0
Marlin/serial.h View File

84
 FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); }
84
 FORCE_INLINE void serial_echopair_P(const char* s_P, bool v) { serial_echopair_P(s_P, (int)v); }
85
 FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); }
85
 FORCE_INLINE void serial_echopair_P(const char* s_P, void *v) { serial_echopair_P(s_P, (unsigned long)v); }
86
 
86
 
87
+void serial_spaces(uint8_t count);
88
+#define SERIAL_ECHO_SP(C)     serial_spaces(C)
89
+#define SERIAL_ERROR_SP(C)    serial_spaces(C)
90
+#define SERIAL_PROTOCOL_SP(C) serial_spaces(C)
91
+
87
 //
92
 //
88
 // Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
93
 // Functions for serial printing from PROGMEM. (Saves loads of SRAM.)
89
 //
94
 //

Loading…
Cancel
Save