correct availableForWrite signature

This commit is contained in:
hathach committed 2019-08-01 11:28:00 +07:00
1 parent ebd624c7c0
commit 230c6dfd3a
4 files changed
+7 -4

No files matched your search

@@ -97,7 +97,7 @@ int Adafruit_USBD_CDC::peek(void)
int Adafruit_USBD_CDC::read(void)
{
return tud_cdc_read_char();
return (int) tud_cdc_read_char();
}
void Adafruit_USBD_CDC::flush(void)
@@ -126,7 +126,7 @@ size_t Adafruit_USBD_CDC::write(const uint8_t *buffer, size_t size)
return size - remain;
}
size_t Adafruit_USBD_CDC::availableForWrite(void)
int Adafruit_USBD_CDC::availableForWrite(void)
{
return tud_cdc_write_available();
}
@@ -51,7 +51,7 @@ public:
size_t write(const char *buffer, size_t size) {
return write((const uint8_t *)buffer, size);
}
size_t availableForWrite(void);
virtual int availableForWrite(void);
operator bool();
};
@@ -72,7 +72,6 @@
#define CFG_TUD_MIDI_TX_BUFSIZE 64
// Vendor FIFO size of TX and RX
// If not configured vendor endpoints will not be buffered
#define CFG_TUD_VENDOR_RX_BUFSIZE 64
#define CFG_TUD_VENDOR_TX_BUFSIZE 64
+4
View File
@@ -55,6 +55,10 @@ class Print
return write((const uint8_t *)buffer, size);
}
// 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 &);
size_t print(const char[]);