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 17:ac55820c1ae7, committed 2013-12-06
- Comitter:
- rabad1
- Date:
- Fri Dec 06 08:00:44 2013 +0000
- Parent:
- 16:4f6df64750bd
- Commit message:
- Renamed class CircBuffer to CircularBuffer
Changed in this revision
USBSerial/CircBuffer.h | 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/CircBuffer.h Thu Dec 05 13:00:15 2013 +0000 +++ b/USBSerial/CircBuffer.h Fri Dec 06 08:00:44 2013 +0000 @@ -16,20 +16,20 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CIRCBUFFER_H -#define CIRCBUFFER_H +#ifndef CIRCULARBUFFER_H +#define CIRCULARBUFFER_H template <class T> -class CircBuffer { +class CircularBuffer { public: - CircBuffer(int length) { + CircularBuffer(int length) { write = 0; read = 0; size = length + 1; buf = (T *)malloc(size * sizeof(T)); }; - ~CircBuffer() { + ~CircularBuffer() { free(buf); } @@ -71,3 +71,4 @@ }; #endif +
--- a/USBSerial/USBSerial.h Thu Dec 05 13:00:15 2013 +0000 +++ b/USBSerial/USBSerial.h Fri Dec 06 08:00:44 2013 +0000 @@ -153,7 +153,7 @@ private: FunctionPointer rx; - CircBuffer<uint8_t> buf; + CircularBuffer<uint8_t> buf; void (*settingsChangedCallback)(int baud, int bits, int parity, int stop); };