From c24ee10913a5e5c44212b18c74f45aaa974317ee Mon Sep 17 00:00:00 2001 From: Pablo2048 Date: Fri, 7 Feb 2025 13:57:03 +0100 Subject: [PATCH] Add missing availableForWrite() virtual method --- src/arduino/Print.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/arduino/Print.h b/src/arduino/Print.h index f2cdb51..b87a336 100644 --- a/src/arduino/Print.h +++ b/src/arduino/Print.h @@ -57,6 +57,12 @@ class Print size_t write(const char *buffer, size_t size) { return write((const uint8_t *)buffer, size); } + // add availableForWrite to make compatible with Arduino Print.h + // default to zero, meaning "a single write may block" + // should be overriden by subclasses with buffering + virtual int availableForWrite() { + return 0; + } size_t print(const __FlashStringHelper *); size_t print(const String &);