Merge pull request #199 from hathach/develop

revert 6630fe7 availableForWrite() return int
This commit is contained in:
Ha Thach 2019-12-31 11:52:08 +07:00 committed by GitHub
commit 18b64d471f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ class Print
// default to zero, meaning "a single write may block"
// should be overriden by subclasses with buffering
virtual size_t availableForWrite() { return 0; }
virtual int availableForWrite() { return 0; }
size_t print(const __FlashStringHelper *);
size_t print(const String &);

@ -1 +1 @@
Subproject commit 472633c1c4fe2b1c9960fb12bed8c2740d489c51
Subproject commit 09968245ad675377f2265717f0e138d5dccb39a3

View file

@ -160,7 +160,7 @@ int Serial_::available(void)
return usb.available(CDC_ENDPOINT_OUT);
}
size_t Serial_::availableForWrite(void)
int Serial_::availableForWrite(void)
{
// return the number of bytes left in the current bank,
// always EP size - 1, because bank is flushed on every write

View file

@ -129,7 +129,7 @@ public:
void end(void);
virtual int available(void);
virtual size_t availableForWrite(void);
virtual int availableForWrite(void);
virtual int peek(void);
virtual int read(void);
virtual void flush(void);

View file

@ -131,7 +131,7 @@ int Uart::available()
return rxBuffer.available();
}
size_t Uart::availableForWrite()
int Uart::availableForWrite()
{
return txBuffer.availableForStore();
}

View file

@ -33,7 +33,7 @@ class Uart : public HardwareSerial
void begin(unsigned long baudrate, uint16_t config);
void end();
int available();
size_t availableForWrite();
int availableForWrite();
int peek();
int read();
void flush();