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.
Fork of daplink-validation by
Diff: main.cpp
- Revision:
- 3:ffa3bbc3725f
- Parent:
- 2:204ef796ee06
- Child:
- 4:9d5fa3e73be2
--- a/main.cpp Sun Sep 13 01:52:37 2015 +0000
+++ b/main.cpp Fri Sep 18 19:54:50 2015 +0000
@@ -26,7 +26,7 @@
}
bool full() {
- return (head + 1) % size == tail;
+ return head == (tail + 1) % size;
}
void enqueue(uint8_t data) {
@@ -64,13 +64,13 @@
pc.baud(115200);
pc.printf("{init}");
while (1) {
-
+
// Enqueue data as it arrives
if (pc.readable()) {
val = pc.getc();
buf.enqueue(val);
}
-
+
// Process and send data
if (pc.writeable() && !buf.empty()) {
val = buf.dequeue();
