| Index: platforms/stm/disco_dartino/src/circular_buffer.cc
|
| diff --git a/platforms/stm/disco_fletch/src/circular_buffer.cc b/platforms/stm/disco_dartino/src/circular_buffer.cc
|
| similarity index 87%
|
| rename from platforms/stm/disco_fletch/src/circular_buffer.cc
|
| rename to platforms/stm/disco_dartino/src/circular_buffer.cc
|
| index d0ba1efdc22397ccab930fe55d1e68317a78008d..975e2b1c0177f5b469eeb14c61338f86d44c1e03 100755
|
| --- a/platforms/stm/disco_fletch/src/circular_buffer.cc
|
| +++ b/platforms/stm/disco_dartino/src/circular_buffer.cc
|
| @@ -2,13 +2,13 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE.md file.
|
|
|
| -#include "platforms/stm/disco_fletch/src/circular_buffer.h"
|
| +#include "platforms/stm/disco_dartino/src/circular_buffer.h"
|
|
|
| #include <stdlib.h>
|
| #include <string.h>
|
|
|
| CircularBuffer::CircularBuffer(size_t capacity) {
|
| - monitor_ = fletch::Platform::CreateMonitor();
|
| + monitor_ = dartino::Platform::CreateMonitor();
|
| // One additional byte needed to distinguish between empty and full.
|
| capacity_ = capacity + 1;
|
| buffer_ = new uint8_t[capacity_];
|
| @@ -20,17 +20,17 @@ CircularBuffer::~CircularBuffer() {
|
| }
|
|
|
| bool CircularBuffer::IsEmpty() {
|
| - fletch::ScopedMonitorLock locker(monitor_);
|
| + dartino::ScopedMonitorLock locker(monitor_);
|
| return head_ == tail_;
|
| }
|
|
|
| bool CircularBuffer::IsFull() {
|
| - fletch::ScopedMonitorLock locker(monitor_);
|
| + dartino::ScopedMonitorLock locker(monitor_);
|
| return ((head_ + 1) % capacity_) == tail_;
|
| }
|
|
|
| size_t CircularBuffer::Read(uint8_t* data, size_t count, Blocking block) {
|
| - fletch::ScopedMonitorLock locker(monitor_);
|
| + dartino::ScopedMonitorLock locker(monitor_);
|
|
|
| // If buffer is empty wait for data.
|
| if (block == kBlock) {
|
| @@ -63,7 +63,7 @@ size_t CircularBuffer::Read(uint8_t* data, size_t count, Blocking block) {
|
|
|
| size_t CircularBuffer::Write(
|
| const uint8_t* data, size_t count, Blocking block) {
|
| - fletch::ScopedMonitorLock locker(monitor_);
|
| + dartino::ScopedMonitorLock locker(monitor_);
|
|
|
| // If buffer is full wait for room.
|
| if (block == kBlock) {
|
|
|