Skip to content

Commit e975966

Browse files
committed
added availableForWrite
1 parent b4a4e37 commit e975966

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: cores/arduino/Serial.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,12 @@ int UART::available() {
315315
return rxBuffer.available();
316316
}
317317

318+
/* -------------------------------------------------------------------------- */
319+
int UART::availableForWrite() {
320+
/* -------------------------------------------------------------------------- */
321+
return txBuffer.availableForStore();
322+
}
323+
318324
/* -------------------------------------------------------------------------- */
319325
int UART::peek() {
320326
/* -------------------------------------------------------------------------- */

Diff for: cores/arduino/Serial.h

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class UART : public arduino::HardwareSerial {
6565
size_t write(uint8_t* c, size_t len);
6666
size_t write_raw(uint8_t* c, size_t len);
6767
using Print::write;
68+
int availableForWrite();
6869
operator bool(); // { return true; }
6970

7071
private:

0 commit comments

Comments
 (0)