Skip to content

Commit 6630fe7

Browse files
committed
@hathach Arduino core now wants size_t returned
1 parent 9df0b07 commit 6630fe7

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_CDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ size_t Adafruit_USBD_CDC::write(const uint8_t *buffer, size_t size)
126126
return size - remain;
127127
}
128128

129-
int Adafruit_USBD_CDC::availableForWrite(void)
129+
size_t Adafruit_USBD_CDC::availableForWrite(void)
130130
{
131131
return tud_cdc_write_available();
132132
}

cores/arduino/Adafruit_TinyUSB_Core/Adafruit_USBD_CDC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Adafruit_USBD_CDC : public Stream, Adafruit_USBD_Interface
5151
size_t write(const char *buffer, size_t size) {
5252
return write((const uint8_t *)buffer, size);
5353
}
54-
virtual int availableForWrite(void);
54+
virtual size_t availableForWrite(void);
5555
operator bool();
5656
};
5757

cores/arduino/Print.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Print
5858

5959
// default to zero, meaning "a single write may block"
6060
// should be overriden by subclasses with buffering
61-
virtual int availableForWrite() { return 0; }
61+
virtual size_t availableForWrite() { return 0; }
6262

6363
size_t print(const __FlashStringHelper *);
6464
size_t print(const String &);

cores/arduino/USB/CDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int Serial_::available(void)
160160
return usb.available(CDC_ENDPOINT_OUT);
161161
}
162162

163-
int Serial_::availableForWrite(void)
163+
size_t Serial_::availableForWrite(void)
164164
{
165165
// return the number of bytes left in the current bank,
166166
// always EP size - 1, because bank is flushed on every write

cores/arduino/USB/USBAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class Serial_ : public Stream
129129
void end(void);
130130

131131
virtual int available(void);
132-
virtual int availableForWrite(void);
132+
virtual size_t availableForWrite(void);
133133
virtual int peek(void);
134134
virtual int read(void);
135135
virtual void flush(void);

cores/arduino/Uart.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int Uart::available()
131131
return rxBuffer.available();
132132
}
133133

134-
int Uart::availableForWrite()
134+
size_t Uart::availableForWrite()
135135
{
136136
return txBuffer.availableForStore();
137137
}

cores/arduino/Uart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Uart : public HardwareSerial
3333
void begin(unsigned long baudrate, uint16_t config);
3434
void end();
3535
int available();
36-
int availableForWrite();
36+
size_t availableForWrite();
3737
int peek();
3838
int read();
3939
void flush();

0 commit comments

Comments
 (0)