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 CC1101_Transceiver by
Diff: RingBuffer.h
- Revision:
- 0:9df942ea84f4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RingBuffer.h Sun Nov 21 11:37:56 2010 +0000 @@ -0,0 +1,39 @@ +/* + * mbed library for RingBuffer + * Copyright (c) 2010 Hiroshi Suga + * Released under the MIT License: http://mbed.org/license/mit + */ + +#ifndef RingBuffer_H +#define RingBuffer_H + +#include "mbed.h" + +class RingBuffer : public Stream { +public: + RingBuffer (int p_size); +// ~RingBuffer (); + +#if DOXYGEN_ONLY + int putc(int c); + int printf(const char* format, ...); +#endif +// int putc (char); + int put (char *, int); + char get (); + int get (char *, int); + void clear (); + int available (); + int use (); + +private: + // Stream implementation functions + virtual int _putc(int value); + virtual int _getc(); + + char *buf; + int size; + int addr_w, addr_r; +}; + +#endif