Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBDevice by
Revision 60:b1e3889495d3, committed 2015-06-24
- Comitter:
- jpiat
- Date:
- Wed Jun 24 11:27:47 2015 +0000
- Parent:
- 59:dba1951546c3
- Commit message:
- Corrected an error on data type for available method on USBSerial
Changed in this revision
USBSerial/USBSerial.cpp | Show annotated file Show diff for this revision Revisions of this file |
USBSerial/USBSerial.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/USBSerial/USBSerial.cpp Thu Jun 11 18:42:39 2015 +0000 +++ b/USBSerial/USBSerial.cpp Wed Jun 24 11:27:47 2015 +0000 @@ -62,6 +62,6 @@ return true; } -uint8_t USBSerial::available() { +uint16_t USBSerial::available() { return buf.available(); }
--- a/USBSerial/USBSerial.h Thu Jun 11 18:42:39 2015 +0000 +++ b/USBSerial/USBSerial.h Wed Jun 24 11:27:47 2015 +0000 @@ -45,6 +45,7 @@ * @endcode */ class USBSerial: public USBCDC, public Stream { + public: /** @@ -56,7 +57,7 @@ * @param connect_blocking define if the connection must be blocked if USB not plugged in * */ - USBSerial(uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001, bool connect_blocking = true): USBCDC(vendor_id, product_id, product_release, connect_blocking), buf(8192*2){ + USBSerial(uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001, int buf_size = 8192, bool connect_blocking = true): USBCDC(vendor_id, product_id, product_release, connect_blocking), buf(buf_size){ settingsChangedCallback = 0; }; @@ -81,7 +82,7 @@ * * @returns the number of bytes available */ - uint8_t available(); + uint16_t available(); /** Determine if there is a character available to read *