Pranav Thakur / Mbed 2 deprecated daplink-validation

Dependencies:   mbed

Fork of daplink-validation by Russ Butler

Revision:
3:ffa3bbc3725f
Parent:
2:204ef796ee06
Child:
4:9d5fa3e73be2
diff -r 204ef796ee06 -r ffa3bbc3725f main.cpp
--- 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();