mirror of https://github.com/ARMmbed/mbed-os.git
Code style updated
parent
69e6f11c2d
commit
c1ab43ce76
|
@ -106,19 +106,20 @@ public:
|
|||
}
|
||||
|
||||
/** Get the number of elements currently stored in the circular_buffer */
|
||||
CounterType size() const
|
||||
{
|
||||
CounterType size() const {
|
||||
core_util_critical_section_enter();
|
||||
CounterType elements;
|
||||
if (!_full)
|
||||
{
|
||||
if (_head < _tail)
|
||||
if (!_full) {
|
||||
if (_head < _tail) {
|
||||
elements = BufferSize + _head - _tail;
|
||||
else
|
||||
}
|
||||
else {
|
||||
elements = _head - _tail;
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
elements = BufferSize;
|
||||
}
|
||||
core_util_critical_section_exit();
|
||||
return elements;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue