File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ size_t Print::write(const uint8_t *buffer, size_t size)
4141
4242size_t Print::print (const __FlashStringHelper *ifsh)
4343{
44- const char PROGMEM * p = ( const char PROGMEM *) ifsh;
44+ PGM_P p = reinterpret_cast <PGM_P>( ifsh) ;
4545 size_t n = 0 ;
4646 while (1 ) {
4747 unsigned char c = pgm_read_byte (p++);
@@ -53,11 +53,7 @@ size_t Print::print(const __FlashStringHelper *ifsh)
5353
5454size_t Print::print (const String &s)
5555{
56- size_t n = 0 ;
57- for (uint16_t i = 0 ; i < s.length (); i++) {
58- n += write (s[i]);
59- }
60- return n;
56+ return write (s.c_str (), s.length ());
6157}
6258
6359size_t Print::print (const char str[])
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ class Print
5151 return write ((const uint8_t *)str, strlen (str));
5252 }
5353 virtual size_t write (const uint8_t *buffer, size_t size);
54+ size_t write (const char *buffer, size_t size) {
55+ return write ((const uint8_t *)buffer, size);
56+ }
5457
5558 size_t print (const __FlashStringHelper *);
5659 size_t print (const String &);
You can’t perform that action at this time.
0 commit comments