Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: platforms/stm/disco_fletch/src/circular_buffer.h

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platforms/stm/disco_fletch/src/FreeRTOSConfig.h ('k') | platforms/stm/disco_fletch/src/circular_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platforms/stm/disco_fletch/src/circular_buffer.h
diff --git a/platforms/stm/disco_fletch/src/circular_buffer.h b/platforms/stm/disco_fletch/src/circular_buffer.h
deleted file mode 100755
index b728a77813aacd83fec0fd6fe58d5f968bcbae99..0000000000000000000000000000000000000000
--- a/platforms/stm/disco_fletch/src/circular_buffer.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// 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.
-
-#ifndef PLATFORMS_STM_DISCO_FLETCH_SRC_CIRCULAR_BUFFER_H_
-#define PLATFORMS_STM_DISCO_FLETCH_SRC_CIRCULAR_BUFFER_H_
-
-#include <inttypes.h>
-#include <stdlib.h>
-
-#include "src/shared/platform.h"
-
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-// Circular buffer holding bytes.
-class CircularBuffer {
- public:
- enum Blocking {
- kDontBlock,
- kBlock,
- };
-
- // Create a new circular buffer holding up to 'capacity' bytes of
- // data.
- explicit CircularBuffer(size_t capacity);
- ~CircularBuffer();
-
- // Returns whether the buffer is empty.
- bool IsEmpty();
-
- // Returns whether the buffer is full.
- bool IsFull();
-
- // Read up to count bytes into buffer. If block is kBlock the call
- // will not return until at least one byte is read.
- size_t Read(uint8_t* buffer, size_t count, Blocking block);
-
- // Write up to count bytes from buffer. If block is kBlock the call
- // will not return until at least one byte is written.
- size_t Write(const uint8_t* buffer, size_t count, Blocking block);
-
- private:
- fletch::Monitor* monitor_;
- int waiting_;
- uint8_t* buffer_;
- size_t capacity_;
- int head_;
- int tail_;
-};
-
-#endif // PLATFORMS_STM_DISCO_FLETCH_SRC_CIRCULAR_BUFFER_H_
« no previous file with comments | « platforms/stm/disco_fletch/src/FreeRTOSConfig.h ('k') | platforms/stm/disco_fletch/src/circular_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698