File tree 2 files changed +5
-6
lines changed
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)
41
41
42
42
size_t Print::print (const __FlashStringHelper *ifsh)
43
43
{
44
- const char PROGMEM * p = ( const char PROGMEM *) ifsh;
44
+ PGM_P p = reinterpret_cast <PGM_P>( ifsh) ;
45
45
size_t n = 0 ;
46
46
while (1 ) {
47
47
unsigned char c = pgm_read_byte (p++);
@@ -53,11 +53,7 @@ size_t Print::print(const __FlashStringHelper *ifsh)
53
53
54
54
size_t Print::print (const String &s)
55
55
{
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 ());
61
57
}
62
58
63
59
size_t Print::print (const char str[])
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ class Print
51
51
return write ((const uint8_t *)str, strlen (str));
52
52
}
53
53
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
+ }
54
57
55
58
size_t print (const __FlashStringHelper *);
56
59
size_t print (const String &);
You can’t perform that action at this time.
0 commit comments