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.
Dependencies: mbed 4DGL-uLCD-SE mbed-rtos nRF24L01P
Diff: CircularBuf.h
- Revision:
- 35:99aa54a25a9e
- Parent:
- 29:0c6f3c0c992a
- Child:
- 36:c3cac3494e9b
--- a/CircularBuf.h Fri Apr 27 22:01:10 2018 +0000 +++ b/CircularBuf.h Sun Apr 29 15:17:38 2018 +0000 @@ -13,14 +13,20 @@ template <typename T> class CircularBuf { public: - // Arguement: - // size, The size of the underlying array to use + // Argument: + // + /** + * @param size Size of the buffer. + *Assigns a circular buffer of the diven size. + */ CircularBuf(unsigned int size); ~CircularBuf(); - - // Pushes data onto the buffer - // (Adds data to the buffer) + /** + Pushes data onto the buffer + (Adds data to the buffer) // Arguement: + * @param data The array of data to add to the buffer. + * @param size The size of the array "data" // data, The array of data to add // size, The amount of data in the array // Return: @@ -34,9 +40,10 @@ // buffer.push(dataToAdd, 2); // // buffer now contains [15, 23] + */ unsigned int push(T* data, unsigned int size); - + /** // Pops data from the buffer // Arguement: // data, The array of data popped @@ -50,6 +57,7 @@ // buffer.pop(dataToRemove, 2); // // dataToRemove now contains the 2 oldest values that were in buffer + */ unsigned int pop(T* data, unsigned int size); // Amount of data in the buffer