Merge pull request #316 from adafruit/develop

correct availableForWrite signature
This commit is contained in:
hathach authored and GitHub committed 2019-08-05 10:28:29 +07:00
commit 59712df628
4 files changed
+8 -5

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();
};
@@ -42,7 +42,7 @@
#define CFG_TUSB_OS OPT_OS_FREERTOS
#define CFG_TUSB_MEM_SECTION
#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
//--------------------------------------------------------------------
// DEVICE CONFIGURATION
@@ -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[]);