mirror of https://github.com/ARMmbed/mbed-os.git
Refactor circular buffer test to platform folder
parent
546743aeb0
commit
4e263b17b9
|
@ -92,12 +92,12 @@ public:
|
||||||
core_util_critical_section_enter();
|
core_util_critical_section_enter();
|
||||||
if (full()) {
|
if (full()) {
|
||||||
_tail++;
|
_tail++;
|
||||||
if(_tail == BufferSize) {
|
if (_tail == BufferSize) {
|
||||||
_tail = 0;
|
_tail = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_pool[_head++] = data;
|
_pool[_head++] = data;
|
||||||
if(_head == BufferSize) {
|
if (_head == BufferSize) {
|
||||||
_head = 0;
|
_head = 0;
|
||||||
}
|
}
|
||||||
if (_head == _tail) {
|
if (_head == _tail) {
|
||||||
|
@ -117,7 +117,7 @@ public:
|
||||||
core_util_critical_section_enter();
|
core_util_critical_section_enter();
|
||||||
if (!empty()) {
|
if (!empty()) {
|
||||||
data = _pool[_tail++];
|
data = _pool[_tail++];
|
||||||
if(_tail == BufferSize) {
|
if (_tail == BufferSize) {
|
||||||
_tail = 0;
|
_tail = 0;
|
||||||
}
|
}
|
||||||
_full = false;
|
_full = false;
|
||||||
|
|
Loading…
Reference in New Issue