Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

‎cores/arduino/Serial.cpp

Lines changed: 6 additions & 0 deletions
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
/* -------------------------------------------------------------------------- */

‎cores/arduino/Serial.h

Lines changed: 1 addition & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /