Skip to content

Commit e40e387

Browse files
committed
1 parent 046de9b commit e40e387

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cores/arduino/Print.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class Print
5656
return write((const uint8_t *)buffer, size);
5757
}
5858

59+
// default to zero, meaning "a single write may block"
60+
// should be overriden by subclasses with buffering
61+
virtual int availableForWrite() { return 0; }
62+
5963
size_t print(const __FlashStringHelper *);
6064
size_t print(const String &);
6165
size_t print(const char[]);
@@ -82,6 +86,8 @@ class Print
8286
size_t println(void);
8387

8488
void printf(const char[], ...);
89+
90+
virtual void flush() { /* Empty implementation for backward compatibility */ }
8591
};
8692

8793
#endif

0 commit comments

Comments
 (0)