File tree 2 files changed +16
-19
lines changed
2 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,9 @@ extern FILE _uartout;
79
79
#define SERIAL_PROTOCOL_F (x ,y ) (MYSERIAL.print(x,y))
80
80
#define SERIAL_PROTOCOLPGM (x ) (serialprintPGM(PSTR(x)))
81
81
#define SERIAL_PROTOCOLRPGM (x ) (serialprintPGM((x)))
82
- #define SERIAL_PROTOCOLLN (x ) (MYSERIAL.println(x)/*,MYSERIAL.write('\n')*/ )
83
- #define SERIAL_PROTOCOLLNPGM (x ) (serialprintPGM (PSTR(x)),MYSERIAL.println() /*write('\n')*/ )
84
- #define SERIAL_PROTOCOLLNRPGM (x ) (serialprintPGM ((x)),MYSERIAL.println() /*write('\n')*/ )
82
+ #define SERIAL_PROTOCOLLN (x ) (MYSERIAL.println(x))
83
+ #define SERIAL_PROTOCOLLNPGM (x ) (serialprintlnPGM (PSTR(x)))
84
+ #define SERIAL_PROTOCOLLNRPGM (x ) (serialprintlnPGM ((x)))
85
85
86
86
87
87
extern const char errormagic [] PROGMEM ;
@@ -115,6 +115,9 @@ void serial_echopair_P(const char *s_P, unsigned long v);
115
115
// I'd rather skip a few CPU ticks than 5.5KB (!!) of FLASH
116
116
void serialprintPGM (const char * str );
117
117
118
+ //The "ln" variant of the function above.
119
+ void serialprintlnPGM (const char * str );
120
+
118
121
bool is_buffer_empty ();
119
122
void process_commands ();
120
123
void ramming ();
Original file line number Diff line number Diff line change @@ -467,22 +467,16 @@ void serial_echopair_P(const char *s_P, double v)
467
467
void serial_echopair_P (const char *s_P, unsigned long v)
468
468
{ serialprintPGM (s_P); SERIAL_ECHO (v); }
469
469
470
- /* FORCE_INLINE*/ void serialprintPGM (const char *str)
471
- {
472
- #if 0
473
- char ch=pgm_read_byte(str);
474
- while(ch)
475
- {
476
- MYSERIAL.write(ch);
477
- ch=pgm_read_byte(++str);
478
- }
479
- #else
480
- // hmm, same size as the above version, the compiler did a good job optimizing the above
481
- while ( uint8_t ch = pgm_read_byte (str) ){
482
- MYSERIAL.write ((char )ch);
483
- ++str;
484
- }
485
- #endif
470
+ void serialprintPGM (const char *str) {
471
+ while (uint8_t ch = pgm_read_byte (str)) {
472
+ MYSERIAL.write ((char )ch);
473
+ ++str;
474
+ }
475
+ }
476
+
477
+ void serialprintlnPGM (const char *str) {
478
+ serialprintPGM (str);
479
+ MYSERIAL.println ();
486
480
}
487
481
488
482
#ifdef SDSUPPORT
You can’t perform that action at this time.
0 commit comments