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.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Diff: utils/MTSCircularBuffer.cpp
- Revision:
- 60:ee9c7a700330
- Parent:
- 46:b30547bf07d5
- Child:
- 65:ed113472b2c1
--- a/utils/MTSCircularBuffer.cpp Fri Dec 20 14:29:29 2013 +0000 +++ b/utils/MTSCircularBuffer.cpp Fri Dec 20 21:36:53 2013 +0000 @@ -28,8 +28,8 @@ readIndex = 0; } data[i++] = buffer[readIndex++]; + checkThreshold(); } - checkThreshold(); return i; } @@ -49,13 +49,13 @@ int MTSCircularBuffer::write(const char* data, int length) { int i = 0; - while((i < length) && (available() < bufferSize)) { + while((i < length) && capacity()) { if(writeIndex == bufferSize) { writeIndex = 0; } buffer[writeIndex++] = data[i++]; + checkThreshold(); } - checkThreshold(); return i; }